Error from Rule on Unused Object

Problem statement

This article explains a potential reason for seeing the following error in a SAML response when the Rule itself doesn’t call the samlConfiguration object anywhere:

"Cannot read properties of undefined (reading 'samlConfiguration')"

Symptoms

Customer is seeing an error in the SAML response:

  • "Cannot read properties of undefined (reading 'samlConfiguration')"

The error goes away when they disable the auth0-account-link-extension Rule, which is the only piece of extensibility code in their tenant. The Rule itself doesn’t call the samlConfiguration object anywhere.

Troubleshooting

The customer has customized the account linking Rule as follows:

if(!context.request.query.response_type){
    return callback();
  }

Calling callback with no user or context as the 2nd and 3rd arguments is likely what is producing these nonsensical errors.

Cause

One potential cause is calling return callback(); with no user or context in the 2nd and 3rd arguments.

Solution

When using return callback(); use the following arguments:
return callback(null, user, context);