Auth0 Home Blog Docs

Hosted Passwordless with prefill of email address?

passwordless
hosted-login-page

#1

Hi

I have a hosted login page where I allow the user to login/signup with social login or passwordless (email).

I open the login page from AngularJS like this:

angularAuth0.authorize({
	allowed_connections: ['linkedin', 'facebook', 'google-oauth2', 'windowslive', 'email'],
	language: lang,
	nonce: getNonce(),
	login_hint: "test@example.com"
});

and at the hosted page, I do this:

var config = JSON.parse(decodeURIComponent(escape(window.atob('@@config@@'))));
config.extraParams = config.extraParams || {};

var allowed_connections = config.extraParams.allowed_connections;
var language = config.extraParams.language;
var loginHint = config.extraParams.login_hint;
var prompt = config.prompt;

var lock = new Auth0LockPasswordless(config.clientID, config.auth0Domain, {
      auth: {
        redirectUrl: config.callbackURL,
        responseType: (config.internalOptions || {}).response_type ||
          (config.callbackOnLocationHash ? 'token' : 'code'),
        params: config.internalOptions
      },
      assetsUrl:  config.assetsUrl,
      allowedConnections: allowed_connections ? allowed_connections : null,
      rememberLastLogin: !prompt,
      language: language,
      languageDictionary: i18n[language],
      prefill: loginHint ? { email: loginHint, username: loginHint } : null,
      theme: {
        primaryColor: '#4C66AC',
        labeledSubmitButton: false
      },
      closable: false,

      // we want small buttons for social providers
      socialButtonStyle: 'small'
    });

lock.show();

But the email doesn’t get prefilled!. Is there a mistake in my code, or can the passwordless email field not be prefilled?


#2

Update

I have installed “Real-time Webtask Logs” and can see the login_hint is part of the context object… I’t just doesn’t get used in the email field

{
  "request": {
    "query": {
      "protocol": "oauth2",
      "client_id": "...",
      "response_type": "token id_token",
      "redirect_uri": "https://.../auth0/callback",
      "scope": "openid email profile user_metadata app_metadata",
      "audience": "https://....eu.auth0.com/userinfo",
      "allowed_connections": [Object],
      "language": "da",
      "nonce": "...",
      "login_hint": "test@example.com",
      "state": "...",
      "auth0Client": "...",
      "verification_code": "632603",
      "_intstate": "deprecated",
      "_csrf": "...",
      "connection": "email",
      "email": "...",
      "popup": false
    }
  }
}

#3

Any updates to this?


#4

No. I’m still waiting for a response from someone who knows if/how this is possible.