Account link extension fails with Bad Request error

The rule hard codes the tenant information

var config = {
  endpoints: {
    linking: 'https://tenant-A.au12.webtask.io/abc123',
    userApi: auth0.baseUrl + '/users',
    usersByEmailApi: auth0.baseUrl + '/users-by-email'
  },
  token: {
    clientId: 'fkjafadksfakfakdfkald',
    clientSecret: '********',
    issuer: auth0.domain
  }
};

And this was the root cause. When the rule was deployed into tenant B, the rule code from the extension was overwritten by code from tenant A, so the rule was using the extension host in tenant A.

This goes against Auth0 best practise as the code should be tenant agnostic with the tenant information being injected via configuration. I’ve since updated the code to have keyword placeholders. I’ve also updated my build pipeline to check for hardcoded config values and fail if any are found.

1 Like