Lock SDK Fails - 404 on cdn for clientID.js File

Overview

When using a customized login page powered by Lock, the login page fails to load, and a 404 error is seen calling:

https://cdn.<region>.auth0.com/client/<clientID>.js

Applies To

  • Lock
  • SDK
  • 404 error

Cause

This is a legacy URL format for fetching the client configuration file, used by outdated versions of Lock.

The newer version of the URL uses the tenant’s domain, e.g. https://<tenant-domain>/client/<client-id>.js

Solution

Updating to the latest version of Lock should resolve the issue. Check out this link for details

If there is a reason the Lock version cannot be upgraded, then the following lines can be added to update the URL used to fetch the client configuration file:

//prior code omitted for brevity
var lock = new Auth0Lock(config.clientID, config.auth0Domain, {
      auth: {
        redirectUrl: config.callbackURL,
        responseType: (config.internalOptions || {}).response_type ||
          (config.callbackOnLocationHash ? 'token' : 'code'),
        params: config.internalOptions
      },
configurationBaseUrl: config.clientConfigurationBaseUrl,
      overrides: {
        __tenant: config.auth0Tenant,
        __token_issuer: config.authorizationServer.issuer
      },
//rest of code...

NOTE: Only the latest version of Auth0 SDKs is supported when using a custom login page. Upgrading the SDK version becomes the tenant admin’s responsibility.

Related References