Custom universal login page get realm value dynamic as per client id

 var params = Object.assign({
            /* additional configuration needed for use of custom domains */
            overrides: {
              __tenant: config.auth0Tenant,
              __token_issuer: 'login.****.com'
            },
            domain: config.auth0Domain,
            clientID: config.clientID,
            redirectUri: config.callbackURL,
            responseType: 'code'
        }, config.internalOptions);

var webAuth = new auth0.WebAuth(params);
var databaseConnection = "my_databse_connect";

function login(e) {
    e.preventDefault();
    var username = document.getElementById('email').value;
    var password = document.getElementById('password').value;
    webAuth.login({
        realm: databaseConnection,
        username: username,
        password: password
    }, function (err) {
         if (err) displayMessage(err);
    });
}

in this code i want get realm: databaseConnection, this value as per my application it should be fetched dynalically as the auth0 lock does.

please someone help.

Welcome to Auth0 Community, @siddhant.

To understand what’s going on, can you please elaborate more on where you are using this code and your use case?

Thank you!

hello hi, thanks for the reply,

I am using this code in a custom universal login template and what I am trying is to authorize different applications with different auth0 databases but in the above code I have to give the database name because of that I only able to use one database. That is why I want something that with when an application is used for login i am able to get connection(databaseConnection) name with it and can pass it in realm: databaseConnection, here.

thank you.

1 Like

Im struggling with this atm. Any update on this?

@supun would you be able to follow-up on this? Thank you!