# Custimize Login

**URL:** <https://community.auth0.com/t/custimize-login/66287>\
**Category:** Get Help\
**Tags:** login\
**Created:** [July 16, 2021, 1:00pm UTC](https://community.auth0.com/t/custimize-login/66287 "2021-07-16T13:00:06Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![ThomasTBG](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/thomastbg/32/30381_2.png) [@ThomasTBG](https://community.auth0.com/u/ThomasTBG)\
**Post date:** [July 16, 2021, 1:00pm UTC](https://community.auth0.com/t/custimize-login/66287/1 "2021-07-16T13:00:06Z")

</div>

Hi community!

I’m looking to create a customized login (instead of using the classic universal one)

I’ve changed the settings of my login page via [Auth0 Dashboard \> Branding \> Universal Login](https://manage.auth0.com/#/login_setting).

Furthermore, I’m using Webflow as a website builder and used the below code to transfer from my ‘Webflow page’ to the Auth0 login page:

```auto
<script src="https://cdn.auth0.com/js/lock/11.30.2/lock.min.js"></script>
<script type="text/javascript">

var getUrlParameter = function getUrlParameter(sParam) {
    var sPageURL = window.location.search.substring(1),
        sURLVariables = sPageURL.split('&'),
        sParameterName,
        i;

    for (i = 0; i < sURLVariables.length; i++) {
        sParameterName = sURLVariables[i].split('=');

        if (sParameterName[0] === sParam) {
            return sParameterName[1] === undefined ? true : decodeURIComponent(sParameterName[1]);
        }
    }
};

ref = getUrlParameter('ref'); 

var options = {
	allowLogin: false,
  	auth: {
    	redirectUrl: 'https://www.thebabygoat.de/about/the-goat-tribe/my-app'
	},
  popupOptions: { width: 300, height: 400, left: 200, top: 300 },
  additionalSignUpFields: [
	{
	type: "hidden",
	name: "ref",
	value: ref
	}
	]
	};

// Initializing our Auth0Lock
var lock = new Auth0Lock(
  'I98AAgGzeIxHMzVXsTgwAXizYBg82dX0',
  'thebabygoat.eu.auth0.com', options
);

lock.show();
</script>

<script> 

</script>

```

Does someone know how to make sure that my customize login would then show? That would be great!

Thank you!

Best regards,  
Thomas

---

<div class="post-metadata">

**Author:** ![sgo](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/sgo/32/13789_2.png) [@sgo](https://community.auth0.com/u/sgo)\
**Post date:** [July 16, 2021, 3:24pm UTC](https://community.auth0.com/t/custimize-login/66287/2 "2021-07-16T15:24:43Z")

</div>

Hi @ThomasTBG ,

It looks like you are doing an embedded login page, if you wanted to use the branding settings on your tenant, you would need to be using the login page hosted by Auth0, accessed by directing users to the `/authorize` URL for your tenant instead.

For embedded login using Lock, you need to set all the branding etc. within the initialisation’s options, for example by setting the `theme` options in your code: [https://auth0.com/docs/libraries/lock/lock-configuration#theme](https://auth0.com/docs/libraries/lock/lock-configuration#theme)

[https://auth0.com/docs/universal-login/universal-vs-embedded-login](https://auth0.com/docs/universal-login/universal-vs-embedded-login)

---

<div class="post-metadata">

**Author:** ![ThomasTBG](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/thomastbg/32/30381_2.png) [@ThomasTBG](https://community.auth0.com/u/ThomasTBG)\
**Post date:** [July 19, 2021, 12:42pm UTC](https://community.auth0.com/t/custimize-login/66287/3 "2021-07-19T12:42:31Z")

</div>

Hi sgo,

Thank you for your help with this matter.

Could you help me change the above code so that I’m either using the login page hosted by Auth0 or even better changing all the branding within the initialisation’s option by setting the theme in the code?

I’m looking to integrate our,  
logo: [https://uploads-ssl.webflow.com/5d2483c470f334f7d6a4a7c9/5dc722c32058974c227fddba\_The%2520Baby%2520Goat.png-p-500.png](https://uploads-ssl.webflow.com/5d2483c470f334f7d6a4a7c9/5dc722c32058974c227fddba_The%2520Baby%2520Goat.png-p-500.png)  
primaryColor: #929292  
Page Background Color: #000000

Again, thank you so much for your help.

Looking forward to hearing from you!

Best regards,  
Thomas

---

<div class="post-metadata">

**Author:** ![sgo](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/sgo/32/13789_2.png) [@sgo](https://community.auth0.com/u/sgo)\
**Post date:** [July 26, 2021, 4:16pm UTC](https://community.auth0.com/t/custimize-login/66287/4 "2021-07-26T16:16:20Z")

</div>

Hi @ThomasTBG ,

Sorry for the delay!

If you have to use an embedded login page, then you would need to set the theme object manually in the code as opposed to pulling it out of a config object like the hosted (universal) login page can.

For your case, it would be like this:

```auto
var page_background_color = #000000
var lock = new Auth0Lock(<clientID>,<auth0Domain>) {
//other options ommitted for brevity
  theme: {
        logo: 'https://uploads-ssl.webflow.com/5d2483c470f334f7d6a4a7c9/5dc722c32058974c227fddba_The%2520Baby%2520Goat.png-p-500.png'
        primaryColor: '#929292',
         },
//any remaining lock options
});
 if(page_background_color) {
      var css = '.auth0-lock.auth0-lock .auth0-lock-overlay { background: ' +
                 page_background_color +
                ' }';

      var style = document.createElement('style');

      style.appendChild(document.createTextNode(css));

      document.body.appendChild(style);
    }
lock.show();

```

The Lock reference linked below should also help with any other tweaks you wish to make to the Lock UI/behaviour:

- [https://auth0.com/docs/libraries/lock](https://auth0.com/docs/libraries/lock)
- [https://auth0.com/docs/libraries/lock/lock-ui-customization](https://auth0.com/docs/libraries/lock/lock-ui-customization)

I’d recommend using the Universal (hosted) login page though if Webflow can support it rather than embedded, it has several benefits over using an embedded form. There are some default templates available in Branding \> Universal Login \> Login you can use as a starting point when you toggle on “Customize Login Page”.

This will use the theming you have set in your tenant’s Branding settings then, using the config object to pull out the settings (`let colours = config.colors || {}`), before using it in the theme property. See below for the default Lock template (at time of writing).

```auto

<script src="https://cdn.auth0.com/js/lock/11.30/lock.min.js"></script>
  <script>
    // 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;
    var colors = config.colors || {};

    // 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: 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();
  </script>

```

To reach the Lock page, you’d need to begin an “authorize” flow to redirect the user to Auth0’s Universal Login page. We have multiple SDKs which can handle this for you if Webflow will allow you to incorporate them. For example Auth0.js could be used to begin the flow:

- [Auth0.js v9 Reference](https://auth0.com/docs/libraries/auth0js#webauth-authorize-)
- [Auth0 Libraries](https://auth0.com/docs/libraries)

---

<div class="post-metadata">

**Author:** ![ThomasTBG](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/thomastbg/32/30381_2.png) [@ThomasTBG](https://community.auth0.com/u/ThomasTBG)\
**Post date:** [July 28, 2021, 9:51am UTC](https://community.auth0.com/t/custimize-login/66287/5 "2021-07-28T09:51:48Z")

</div>

Hi @sgo,

Big thank you for your help and long message here!

I’ve tried using your embedded login page coding and set the theme object manually in the code. However, the pop-up doesn’t seem to be working anymore if I change anything on the theme design (Background Color, Logo, or Primary Color)

Might this be something that Auth0 doesn’t allow me to do?

I’d happily share my code with you if you’d like to have a look.

Looking forward to hearing from you!

Best regards,  
Thomas

---

<div class="post-metadata">

**Author:** ![sgo](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/sgo/32/13789_2.png) [@sgo](https://community.auth0.com/u/sgo)\
**Post date:** [August 10, 2021, 2:30pm UTC](https://community.auth0.com/t/custimize-login/66287/6 "2021-08-10T14:30:17Z")

</div>

Hey @ThomasTBG - if you are still impacted by this please could you share the code?

---

<div class="post-metadata">

**Author:** ![ThomasTBG](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/thomastbg/32/30381_2.png) [@ThomasTBG](https://community.auth0.com/u/ThomasTBG)\
**Post date:** [August 10, 2021, 2:39pm UTC](https://community.auth0.com/t/custimize-login/66287/7 "2021-08-10T14:39:14Z")

</div>

Hi @sgo ,

Thank you for your response and your help. Would indeed be lovely if you can have a look. This is the code:

```auto
<script src="https://cdn.auth0.com/js/lock/11.30.2/lock.min.js"></script>
<script type="text/javascript">

var getUrlParameter = function getUrlParameter(sParam) {
    var sPageURL = window.location.search.substring(1),
        sURLVariables = sPageURL.split('&'),
        sParameterName,
        i;

    for (i = 0; i < sURLVariables.length; i++) {
        sParameterName = sURLVariables[i].split('=');

        if (sParameterName[0] === sParam) {
            return sParameterName[1] === undefined ? true : decodeURIComponent(sParameterName[1]);
        }
    }
};

ref = getUrlParameter('ref'); 

var options = {
	allowLogin: false,
  	auth: {
    	redirectUrl: 'https://www.thebabygoat.de/about/the-goat-tribe/my-app'
	},
  popupOptions: { width: 300, height: 400, left: 200, top: 300 },
  additionalSignUpFields: [
	{
	type: "hidden",
	name: "ref",
	value: ref
	}
	]
	};

// Initializing our Auth0Lock
var lock = new Auth0Lock(
  'I98AAgGzeIxHMzVXsTgwAXizYBg82dX0',
  'thebabygoat.eu.auth0.com', options
);

lock.show();
</script>

```

And this is the URL where it’s currently live on:

> **[Sign-up - The Baby Goat](https://www.thebabygoat.de/welcome)**
>
> Join our beer Community. Join The GOAT Tribe.

Thanks a lot!!

Best regards,  
Thomas

---

<div class="post-metadata">

**Author:** ![sgo](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/sgo/32/13789_2.png) [@sgo](https://community.auth0.com/u/sgo)\
**Post date:** [August 10, 2021, 3:28pm UTC](https://community.auth0.com/t/custimize-login/66287/8 "2021-08-10T15:28:33Z")

</div>

Thanks Thomas,

I tried out your code locally and was able to add in some theming to the options object successfully:

```auto
//rest of code omitted for brevity

var options = {
	allowLogin: true,
  	auth: {
    	redirectUrl: 'http://localhost:3000'
	},
  popupOptions: { width: 300, height: 400, left: 200, top: 300 },
  additionalSignUpFields: [
	{
	type: "hidden",
	name: "ref",
	value: ref
	}
	],
    theme: {
    logo: "https://uploads-ssl.webflow.com/5d2483c470f334f7d6a4a7c9/5dc722c32058974c227fddba_The%2520Baby%2520Goat.png-p-500.png",
    labeledSubmitButton: false,
    primaryColor: "#929292",
    authButtons: {
       "google-oauth2": {
           primaryColor: "#000000",
           foregroundColor: "#929292",
           }
       }
    }
  };

```

This gave me this popup:

 ![Screenshot 2021-08-10 at 16.24.49](https://global.discourse-cdn.com/auth0/original/3X/0/1/01e61507da5f8004036db37d05474bc2c4a97cf6.jpeg)

Could you please compare that to what you used previously and let me know if you have any further queries/issues?

---

<div class="post-metadata">

**Author:** ![ThomasTBG](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/thomastbg/32/30381_2.png) [@ThomasTBG](https://community.auth0.com/u/ThomasTBG)\
**Post date:** [August 11, 2021, 7:43am UTC](https://community.auth0.com/t/custimize-login/66287/9 "2021-08-11T07:43:10Z")

</div>

Amazing. You are a here @sgo.

Cheers,  
Thomas

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [August 11, 2021, 9:52am UTC](https://community.auth0.com/t/custimize-login/66287/10 "2021-08-11T09:52:44Z")

</div>

Glad it’s working for you now Thomas!

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [August 26, 2021, 9:19am UTC](https://community.auth0.com/t/custimize-login/66287/11 "2021-08-26T09:19:06Z")

</div>


