Lock Configuration Options


The Auth0Lock can be configured through the options parameter sent to the constructor. These options can alter the way that the Lock widget behaves, how it deals with connections, additional signup fields that you require for your project, the language and text values, colors, and images on the widget, and many more. Take a look at the index below if you know what you are looking for, or browse the options for more details.

Index of Configurable Options


Option Description
allowAutocomplete Whether or not to allow autocomplete in the widget
allowedConnections limit the application connections shown in Lock to a particular set
allowShowPassword Whether to allow the user to show password as typing
autoclose Whether or not Lock auto closes after a login
autofocus Whether or not focus is set on first input field
avatar Obtain avatar from a non gravatar source
closable Whether or not Lock is closable
container Embed Lock in a container
language Change the language of Lock
languageDictionary Change text in particular sections of Lock
popupOptions Customize the location of the popup
rememberLastLogin Whether to remember the last login option chosen


Option Description
theme The theme object contains the below theming options
authButtons Customize the appearance of specific connection buttons
labeledSubmitButton whether or not the submit button has text
logo What logo should be used
primaryColor Color of the primary button on the widget


Option Description
auth The auth object contains the below auth options
audience The API which will be consuming your Access Token
autoParseHash Whether or not to automatically parse hash and continue
connectionScopes Specify connection scopes
params Option to send parameters at login
redirect Whether or not to use redirect mode
redirectUrl The URL to redirect to after auth
responseMode Option to send response as POST
responseType Response as a code or token


Option Description
additionalSignUpFields Additional fields collected at signup
allowLogin Whether or not to allow login on widget
allowForgotPassword Whether or not to allow forgot password on widget
allowSignUp Whether or not to allow signup on widget
defaultDatabaseConnection Default shown DB connection
initialScreen Which screen to show when the widget is opened
loginAfterSignUp After signup, whether or not to auto login
forgotPasswordLink Link to a custom forgot password page
mustAcceptTerms Whether or not terms must be accepted (checkbox)
prefill Prefill values for email/username fields
signUpLink Set a custom url to fire when clicking "sign up"
usernameStyle Limit username field to accept only "username" values or only "email" values


Option Description
defaultEnterpriseConnection Specifies a connection if more than one present
defaultADUsernameFromEmailPrefix Resolve the AD placeholder username from the email's prefix


Option Description
configurationBaseUrl Override your application's base URL
languageBaseUrl Override your language file base URL
hashCleanup Override the default removal of the hash from the URL
leeway Add leeway for clock skew to JWT expiration times

Display Options

allowAutocomplete {Boolean}

Determines whether or not the email or username inputs will allow autocomplete (<input autocomplete />). Defaults to false.

allowedConnections {Array}

Array of connections that will be used for the signin|signup|reset actions. Defaults to all enabled connections.

Examples of allowedConnections:

Lock - Allowed Connections

Lock - Allowed Connections

allowShowPassword {Boolean}

This option determines whether or not to add a checkbox to the UI which, when selected, will allow the user to show their password when typing it. The option defaults to false.

Lock with allowShowPassword set to true and toggled to show the password:

Lock - Avatar

autoclose {Boolean}

Determines whether or not the Lock will be closed automatically after a successful sign in. Defaults to false.

If the Lock is not closable it won't be closed, even if this option is set to true.

autofocus {Boolean}

If true, the focus is set to the first field on the widget. Defaults to false when being rendered on a mobile device, or if a container option is provided; defaults to true in all other cases.

avatar {Object}

By default, Gravatar is used to fetch the user avatar and display name, but you can obtain them from anywhere with the avatar option.

Or, if you want to display no avatar at all, simply pass in null.

Default behavior with Gravatar:

Lock - Avatar

closable {Boolean}

Determines whether or not the Lock can be closed. When a container option is provided its value is always false, otherwise it defaults to true.

Lock - Closable

container {String}

The id of the html element where the widget will be shown.

This makes the widget appear inline within your div instead of in a modal pop-out window.

Lock - Container

language {String}

Specifies the language of the widget. Defaults to "en". See the internationalization directory for a current list of provided languages.

Lock - Language

languageDictionary {Object}

Allows customization of every piece of text displayed in the Lock. Defaults to {}. See English language Language Dictionary Specification for the full list of languageDictionary values able to be altered with this object.

Lock - Language Dictionary

Additionally, check out the Customizing Error Messages page or the Internationalization page for more information about the use of the languageDictionary option.

Allows the customization the location of the popup in the screen. Any position and size feature allowed by is accepted. Defaults to {}.

Options for the position and size features. This only applies if redirect is set to false.

rememberLastLogin {Boolean}

Determines whether or not to show a screen that allows you to quickly log in with the account you used the last time. Requests Single Sign-on (SSO) data and enables a Last time you signed in with[...] message. Defaults to true. This information comes from the user's Auth0 session, so this ability will last as long as their Auth0 session would (which is configurable).

The Last time you signed in with [...] message will not be available under the following circumstances:

Theming Options

theme {Object}

Theme options are grouped in the theme property of the options object.

authButtons {Object}

Allows the customization of buttons in Lock with custom OAuth2 connections. Each custom connection whose button you desire to customize should be listed by name, each with their own set of parameters. The customizable parameters are listed below:

  • displayName {String}: The name to show instead of the connection name when building the button title, such as LOGIN WITH MYCONNECTION for login).
  • primaryColor {String}: The button's background color. Defaults to #eb5424.
  • foregroundColor {String}: The button's text color. Defaults to #FFFFFF.
  • icon {String}: The URL of the icon for this connection. For example:

labeledSubmitButton {Boolean}

This option indicates whether or not the submit button should have a label, and defaults to true. When set to false, an icon will be shown instead.

Lock - Labeled Submit Button

If the label is set to true, which is the default, the label's text can be customized through the languageDictionary option.

logo {String}

The value for logo is a URL for an image that will be placed in the Lock's header, and defaults to Auth0's logo. It has a recommended max height of 58px for a better user experience.

Lock - Theme - Logo

primaryColor {String}

The primaryColor property defines the primary color of the Lock; all colors used in the widget will be calculated from it. This option is useful when providing a custom logo, to ensure all colors go well together with the logo's color palette. Defaults to #ea5323.

Lock - Theme - Primary Color

Social Options

Authentication Options

auth {Object}

Authentication options are grouped in the auth property of the options object.

audience {String}

The audience option indicates the API which will be consuming the Access Token that is received after authentication.

autoParseHash {Boolean}

When autoParseHash is set to true, Lock will parse the window.location.hash string when instantiated. If set to false, you'll have to manually resume authentication using the resumeAuth method.

connectionScopes {Object}

This option allows you to set scopes to be sent to the oauth2/social connection for authentication.

A listing of particular scopes for your social connections can be acquired from the provider in question. For example, Facebook for Developers reference has a listing of separate permissions that can be requested for your connection.

params {Object}

You can send parameters when starting a login by adding them to the options object. The example below adds a state parameter with a value equal to foo and also adds a scope parameter (which includes the scope, and then the requested attributes). Read here to learn more about what authParams can be set.

For more details about supported parameters check the Authentication Parameters documentation page.

redirect {Boolean}

Defaults to true. When set to true, redirect mode will be used. If set to false, popup mode is chosen.

redirectUrl {String}

The URL Auth0 will redirect back to after authentication. Defaults to the empty string "" (no redirect URL).

When the redirectUrl is provided (set to non blank value) the responseType option will be defaulted to code if not manually set.

responseMode {String}

Should be set to "form_post" if you want the code or the token to be transmitted via an HTTP POST request to the redirectUrl, instead of being included in its query or fragment parts.

Otherwise, this option should be omitted, and is omitted by default.

responseType {String}

The value of responseType should be set to "token" for Single-Page Applications, and "code" otherwise. Defaults to "code" when redirectUrl is provided, and to "token" otherwise.

When the responseType is set to code, Lock will never show the Last time you logged in with message, and will always prompt the user for credentials.

Database Options

additionalSignUpFields {Array}

Extra input fields can be added to the sign up screen with the additionalSignUpFields option. Each option added in this manner will then be added to that user's user_metadata. See Metadata for more information. Every input must have a name and a placeholder, and an icon URL can also be provided. Also, the initial value can be provided with the prefill option, which can be a string with the value or a function that obtains it. Other options depend on the type of the field, which is defined via the type option and defaults to "text".

Intended for use with database signup only

additionalSignUpFields are intended for use with database signups only. If you have social sign ups too, you can ask for the additional information after the users sign up (see this page about custom signup for more details). You can use the databaseAlternativeSignupInstructions i18n key to display these instructions.

The new fields are rendered below the regular sign up input fields in the order they are provided.

Text Fields

Text fields are the default type of additional signup field. Note that a validator function can also be provided.

If you don't specify a validator the text field will be required. If you want to make the text field optional, use a validator that always returns true like this:

Lock - Additional Signup Fields

Select Field

The signup field type: "select" will allow you to use select elements for the user to choose a value from.

The options array items for select fields must adhere to the following format: {label: “non empty string”, value: “non empty string”}, and at least one option must be defined.

The options and prefill values can be provided through a function:

Checkbox Field

The third type of custom signup field is the type: "checkbox". The prefill value can determine the default state of the checkbox (true or false), and it is required.

Hidden field

The signup field type: "hidden" will allow you to use a hidden input with a fixed value.

Some use cases may be able to use additionalSignUpFields data for email templates, such as an option for language preferences, the value of which could then be used to set the language of templated email communications.

allowLogin {Boolean}

When set to false the widget won't display the login screen. This is useful if you want to use the widget just for signups (the login and signup tabs in the signup screen will be hidden) or to reset passwords (the back button in the forgot password screen will be hidden). In such cases you may also need to specify the initialScreen, allowForgotPassword and allowSignUp options. It defaults to true.

Lock - Allow Login

allowForgotPassword {Boolean}

When set to false, allowForgotPassword hides the "Don't remember your password?" link in the Login screen, making the Forgot Password screen unreachable. Defaults to true.

Keep in mind that if you are using a database connection with a custom database which doesn't have a change password script the Forgot Password screen won't be available.

Lock - Allow Forgot Password

allowSignUp {Boolean}

When set to false, hides the login and sign up tabs in the login screen, making the sign up screen unreachable. Defaults to true. Keep in mind that if the database connection has sign ups disabled or you are using a custom database which doesn't have a create script, then the sign up screen won't be available.

Also bear in mind that this option only controls client-side appearance, and does not completely stop new sign ups from determined anonymous visitors. If you are looking to fully prevent new users from signing up, you must use the Disable Sign Ups option in the dashboard, in the connection settings.

Lock - Social Button Style

defaultDatabaseConnection {String}

Specifies the database connection that will be used when there is more than one available.

initialScreen {String}

The name of the screen that will be shown when the widget is opened. Valid values are login, signUp, and forgotPassword. If this option is left unspecified, the widget will default to the first screen that is available from that list.

loginAfterSignUp {Boolean}

Determines whether or not the user will be automatically signed in after a successful sign up. Defaults to true.

Set the URL for a page that allows the user to reset their password. When set to a non-empty string, the user will be sent to the provided URL when clicking the "Don't remember your password?" link in the login screen.

mustAcceptTerms {Boolean}

When set to true displays a checkbox input alongside the terms and conditions that must be checked before signing up. The terms and conditions can be specified via the languageDictionary option. This option will only take effect for users signing up with database connections. Defaults to false.

prefill {Object}

Allows to set the initial value for the email and/or username inputs. When omitted, no initial value will be provided.

Set the URL to be requested when clicking on the Signup button.

Side effects

When set to a non empty string, this option forces allowSignUp to true.

usernameStyle {String}

Determines what will be used to identify the user for a Database connection that has the requires_username flag set (if it is not set, usernameStyle option will be ignored). Possible values are "username" and "email". By default both username and email are allowed; setting this option will limit logins to use one or the other.

Enterprise Options

defaultEnterpriseConnection {String}

Specifies the enterprise connection which allows to login using a username and a password that will be used when there is more than one available or there is a database connection. If a defaultDatabaseConnection is provided the database connection will be used and this option will be ignored.

defaultADUsernameFromEmailPrefix {Boolean}

Resolve the AD placeholder username from the email's prefix. Defaults to true.

Passwordless Options

passwordlessMethod {String}

When using Auth0LockPasswordless with an email connection, you can use this option to pick between sending a code or a magic link to authenticate the user. Available values for email connections are code and link. The option defaults to code, and passwordless with SMS connections will always use code.

Other Options

configurationBaseUrl {String}

This option can provide a URL to override the application settings base URL. By default, it uses Auth0's CDN URL when the domain has the format * For example, if your URL is, then by default, the clientBaseUrl is If the clientBaseUrl option is set to something else instead, it uses the provided domain. This would only be necessary if your specific use case dictates that your application not use the default behavior.

languageBaseUrl {String}

Overrides the language source url for Auth0's provided translations. By default, this option uses Auth0's CDN URL since this is where all of the provided translations are stored. By providing another value, you can use another source for the language translations if needed.

hashCleanup {Boolean}

When the hashCleanup option is enabled, it will remove the hash part of the callback URL after the user authentication. It defaults to true.

leeway {Integer}

The leeway option can be set to an integer - a value in seconds - which can be used to account for clock skew in JWT expirations. Typically the value is no more than a minute or two at maximum.