Migrating Angular 1.x Applications to from Lock v10 to Lock v11


Migration steps

Update Lock

Update the Lock library using npm or yarn.

Once updated, you can add it to your build system or bring it in to your project with a script tag.

If you do not want to use a package manager, you can retrieve Lock from Auth0's CDN.

Update angular-lock

AngularJS (a.k.a. Angular 1.x) applications usually use the angular-lock package. To use Lock v11 you need to update to the latest version (3.x).

You can update the angular-lock library using npm or yarn.

The script files need to be added to your build system, or added to the project with a script tag.

Configure your Auth0 application for embedded login

When implementing embedded login, Lock v11 will use cross-origin calls inside hidden iframes to perform authentication. To make sure this can be done securely, Auth0 needs to know the domains where you will be hosting your applications.

Add the domain to the Allowed Web Origins field. You can find this field in the Application Settings area of your Dashboard.

Allowed Web Origins

Change calls to getProfile()

The deprecated getProfile() function was reimplemented in Lock 11. The previous implementation received an ID Token as a parameter and returned the user profile.

The new implementation requires an Access Token parameter instead.

Remove the oidcConformant parameter

When the oidcConformant flag was set to true, Lock 10 used Cross Origin Authentication, and did not use the '/usernamepassword/login' and '/ssodata' endpoints.

Given Lock 11 always uses Cross Origin Authentication and does not use the '/ssodata' endpoint, this flag is not longer needed. If specified, it will be ignored.

Behavioral Changes in Lock v11

Usage in popup mode

When using popup mode in previous versions of Lock, a new browser window was opened and immediately closed in order to complete the authentication transaction. In Lock 11, that window is opened on a hidden iframe, providing a better user experience.

Last time you logged in with window with authorization code flow

Lock 11 will never show the Last time you logged in with window when using the Authorization Code Flow (that is, when specifying response_type='code'). It will always prompt for credentials.

Last time you logged in with window and redirects

The Last time you logged in with window will never do a redirect, even when the redirect option is set to true. Lock11 still emits the authenticated event and you should subscribe to that event to get the authentication result.

If you want to avoid showing the Lock dialog when there's an existing session in the server, you can use Auth0.js's checkSession() function.

Single sign-on using IP ranges

In earlier versions of Lock, you could configure an IP range in an Active Directory/LDAP connection. You could then use that range to allow integrated Windows Authentication if the user's IP was within the range. When this was true, Lock would display a button that users could click and get redirected to the integrated authentication dialog.

SSO With Lock 10 and Windows IP Ranges

This functionality has been removed from embedded login using Lock 11. There is no IP detection, and the user will need to type user and password in Lock. It is still available when using Universal Login.

Default values

Lock 11 will default the scope parameter to 'openid profile email'. This is to make the Last time you logged in with window work correctly.

If you are running your website from http://localhost or and you do not specify the openid profile email scope when initializing Lock, you may get the following error in the browser console:

This will not happen when you run your application in production, or if you specify the required scope. You can read more about this scenario in the documentation on skipping consent for first-party applications.