Capturing the Device ID in a Classic Login
If your Auth0 login flow uses the Classic Login, you can import the device fingerprinting library using the following script tag:
The version in the below example is likely not up-to-date as the library is updated at least once a week. The version in the example is there for illustration purposes only. The current version string of the library can be seen at the NPM registry. It is recommended to use the latest version.
<script src="https://cdn.verosint.com/verosintjs/0.2.36/verosintjs.umd.js"></script>To generate the device ID and provide it as an authorization parameter, create Auth0Lock with the verosint_deviceid property, similar to the example below:
VerosintJS.getDeviceId().then(
function (deviceid) {
// Available Lock configuration options: https://auth0.com/docs/libraries/lock/lock-configuration
var lock = new Auth0Lock(config.clientID, config.auth0Domain, {
auth: {
redirectUrl: config.callbackURL,
responseType: (config.internalOptions || {}).response_type ||
(config.callbackOnLocationHash ? 'token' : 'code'),
params: {
...config.internalOptions,
verosint_deviceid: deviceid,
}
},
configurationBaseUrl: config.clientConfigurationBaseUrl,
overrides: {
__tenant: config.auth0Tenant,
__token_issuer: config.authorizationServer.issuer
},
assetsUrl: config.assetsUrl,
allowedConnections: connection ? [connection] : null,
rememberLastLogin: !prompt,
language: language,
languageBaseUrl: config.languageBaseUrl,
languageDictionary: languageDictionary,
theme: {
//logo: 'YOUR LOGO HERE',
primaryColor: colors.primary ? colors.primary : 'green'
},
prefill: loginHint ? { email: loginHint, username: loginHint } : null,
closable: false,
defaultADUsernameFromEmailPrefix: false
});
if (colors.page_background) {
var css = '.auth0-lock.auth0-lock .auth0-lock-overlay { background: ' +
colors.page_background +
' }';
var style = document.createElement('style');
style.appendChild(document.createTextNode(css));
document.body.appendChild(style);
}
lock.show();
});Updated 3 days ago