|
<!DOCTYPE html> |
|
<html> |
|
<head> |
|
<meta charset="utf-8"> |
|
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
|
<title>Sign In with Auth0</title> |
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> |
|
</head> |
|
<body> |
|
<div id="nocookies" style="display:none"> |
|
<h1>Blocked cookies</h1> |
|
<p>It seems that cookies are blocked for this domain, which will prevent a successful authentication/authorization flow.</p> |
|
<p>Please <a href="https://www.whatismybrowser.com/guides/how-to-enable-cookies/auto">enable cookies</a> and restart the flow.</p> |
|
</div> |
|
<!--[if IE 8]> |
|
<script src="//cdnjs.cloudflare.com/ajax/libs/ie8/0.2.5/ie8.js"></script> |
|
<![endif]--> |
|
|
|
<!--[if lte IE 9]> |
|
<script src="https://cdn.auth0.com/js/base64.js"></script> |
|
<script src="https://cdn.auth0.com/js/es5-shim.min.js"></script> |
|
<![endif]--> |
|
|
|
<script src="https://cdn.auth0.com/js/lock/11.11/lock.min.js"></script> |
|
<script> |
|
function checkCookie(){ |
|
// Quick test if browser has cookieEnabled host property |
|
if (navigator.cookieEnabled) return true; |
|
// Create cookie |
|
document.cookie = "cookietest=1"; |
|
var ret = document.cookie.indexOf("cookietest=") != -1; |
|
// Delete cookie |
|
document.cookie = "cookietest=1; expires=Thu, 01-Jan-1970 00:00:01 GMT"; |
|
return ret; |
|
} |
|
|
|
// Decode utf8 characters properly |
|
var config = JSON.parse(decodeURIComponent(escape(window.atob('@@config@@')))); |
|
config.extraParams = config.extraParams || {}; |
|
var connection = config.connection; |
|
var prompt = config.prompt; |
|
var languageDictionary; |
|
var language; |
|
|
|
if (config.dict && config.dict.signin && config.dict.signin.title) { |
|
languageDictionary = { title: config.dict.signin.title }; |
|
} else if (typeof config.dict === 'string') { |
|
language = config.dict; |
|
} |
|
|
|
var loginHint = config.extraParams.login_hint; |
|
|
|
// Available Lock configuration options: https://auth0.com/docs/libraries/lock/v11/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 |
|
}, |
|
configurationBaseUrl: config.clientConfigurationBaseUrl, |
|
overrides: { |
|
__tenant: config.auth0Tenant, |
|
__token_issuer: 'YOUR_CUSTOM_DOMAIN' |
|
}, |
|
assetsUrl: config.assetsUrl, |
|
allowedConnections: connection ? [connection] : null, |
|
rememberLastLogin: !prompt, |
|
language: language, |
|
languageDictionary: languageDictionary, |
|
theme: { |
|
//logo: 'YOUR LOGO HERE', |
|
//primaryColor: 'green' |
|
}, |
|
prefill: loginHint ? { email: loginHint, username: loginHint } : null, |
|
closable: false, |
|
// uncomment if you want small buttons for social providers |
|
// socialButtonStyle: 'small' |
|
__useTenantInfo: config.isThirdPartyClient |
|
}); |
|
|
|
if (!checkCookie()) { |
|
// no cookies, display error |
|
document.getElementById("nocookies").style="display:block" |
|
} else { |
|
lock.show(); |
|
} |
|
</script> |
|
</body> |
|
</html> |