# Login issue with custom domain and embedded login

**URL:** <https://community.auth0.com/t/login-issue-with-custom-domain-and-embedded-login/43213>\
**Category:** Get Help\
**Tags:** lock, auth0\
**Created:** [May 18, 2020, 7:43pm UTC](https://community.auth0.com/t/login-issue-with-custom-domain-and-embedded-login/43213 "2020-05-18T19:43:11Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![robi1](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/robi1/32/12835_2.png) [@robi1](https://community.auth0.com/u/robi1)\
**Post date:** [May 18, 2020, 7:43pm UTC](https://community.auth0.com/t/login-issue-with-custom-domain-and-embedded-login/43213/1 "2020-05-18T19:43:11Z")

</div>

Hi guys,

I feel frustrated with your support service. I have created a ticket and nobody has answered, I also called at the phone numbers on the home page. My subscription includes support. Could anyone please help me, the ticket number is: #00456537.

---

<div class="post-metadata">

**Author:** ![karen.bermudez](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/karen.bermudez/32/28446_2.png) [@karen.bermudez](https://community.auth0.com/u/karen.bermudez)\
**Post date:** [May 18, 2020, 8:43pm UTC](https://community.auth0.com/t/login-issue-with-custom-domain-and-embedded-login/43213/2 "2020-05-18T20:43:16Z")

</div>

Hello, @robi1

I am sorry that you feel frustrated. Our Support team is constantly working on help our customers so I am sure they will get back to you anytime soon.

In the meantime, have you followed this documentation? [Configure Features to Use Custom Domains](https://auth0.com/docs/custom-domains/additional-configuration#embedded-lock)

thanks!

---

<div class="post-metadata">

**Author:** ![robi1](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/robi1/32/12835_2.png) [@robi1](https://community.auth0.com/u/robi1)\
**Post date:** [May 18, 2020, 9:01pm UTC](https://community.auth0.com/t/login-issue-with-custom-domain-and-embedded-login/43213/3 "2020-05-18T21:01:02Z")

</div>

@karen.bermudez, thank you for the quick reply.

I already did. this is how my Auth Object is set:

export const environment = {  
auth0: {  
domain: ‘[login.mydomain.com](http://login.mydomain.com)’, //omitted for security  
clientId: ‘\*\*\*\*\*\*\*\*\*\*770hjqcG’, // omitted for security  
callbackURL: `${window.location.origin}/Callback` ,  
appURL: window.location.origin,  
allowedConnections: [‘Username-Password-Authentication’],  
auth0Tenant: “lockhartandleith”,  
authorizationServer: {  
issuer: ‘[login.mydomain.com](http://login.mydomain.com)’,  
}  
}  
}

In the Auth.service.ts we have:  
private options = new BehaviorSubject({  
auth: {  
redirectUrl: environment.auth0.callbackURL,  
responseType: ‘token id\_token’,  
audience: `https://${environment.auth0.domain}/userinfo` ,  
params: {  
scope: ‘openid profile’,  
trainer\_slug: ‘’  
}  
},  
allowedConnections: environment.auth0.allowedConnections,  
autoclose: true,  
oidcConformant: true,  
closable: false,  
rememberLastLogin: false,  
allowForgotPassword: true,  
forgotPasswordLink: `${window.location.origin}/${this.urlSlug}/reset-password` ,  
configurationBaseUrl: ‘[https://cdn.auth0.com](https://cdn.auth0.com)’,  
overrides: {  
\_\_tenant: environment.auth0.auth0Tenant,  
\_\_token\_issuer: environment.auth0.authorizationServer.issuer  
},  
} as Auth0LockConstructorOptions)

```auto
this.lock = new Auth0Lock(
  environment.auth0.clientId,
  environment.auth0.domain,
  this.options.value
);

```

Any thoughts?

---

<div class="post-metadata">

**Author:** ![karen.bermudez](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/karen.bermudez/32/28446_2.png) [@karen.bermudez](https://community.auth0.com/u/karen.bermudez)\
**Post date:** [May 18, 2020, 9:36pm UTC](https://community.auth0.com/t/login-issue-with-custom-domain-and-embedded-login/43213/4 "2020-05-18T21:36:05Z")

</div>

Hello!

After reading your code I found why you are getting an error.

If you read this documentation: [Configure Features to Use Custom Domains](https://auth0.com/docs/custom-domains/additional-configuration), it will explain the following:

> If you use the Auth0 APIs, such as the Management API, the API identifier will use your default tenant domain name (such as `https://YOUR_TENANT.auth0.com/userinfo` and `https://YOUR_TENANT.auth0.com/api/v2/` ).

Being said that, when you specify the audience to get `/userinfo` (when you make this call you are calling our Authentication API) you must pass your tenant url and not the custom domain, otherwise this will not work as our API does not identify your custom domain as existent.

> [@robi1](#):
>
> audience: `https://${environment.auth0.domain}/userinfo` ,

This should solve your issue, it seems everything else looks fine on your code.

I hope I got to help you.

Thank you!

---

<div class="post-metadata">

**Author:** ![robi1](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/robi1/32/12835_2.png) [@robi1](https://community.auth0.com/u/robi1)\
**Post date:** [May 18, 2020, 10:11pm UTC](https://community.auth0.com/t/login-issue-with-custom-domain-and-embedded-login/43213/5 "2020-05-18T22:11:18Z")

</div>

@karen.bermudez

I updated my code. When I hit the login button the following is returned:  
{error: “invalid\_token”, errorDescription: “Issuer (iss) claim mismatch in the ID token, expec…“login.gdtr.biz”, found “[https://login.gdtr.biz/](https://login.gdtr.biz/)””}

---

<div class="post-metadata">

**Author:** ![karen.bermudez](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/karen.bermudez/32/28446_2.png) [@karen.bermudez](https://community.auth0.com/u/karen.bermudez)\
**Post date:** [May 18, 2020, 10:15pm UTC](https://community.auth0.com/t/login-issue-with-custom-domain-and-embedded-login/43213/6 "2020-05-18T22:15:50Z")

</div>

Hi!

If you try changing your domains adding the “https://” ?

thanks!

---

<div class="post-metadata">

**Author:** ![robi1](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/robi1/32/12835_2.png) [@robi1](https://community.auth0.com/u/robi1)\
**Post date:** [May 18, 2020, 10:34pm UTC](https://community.auth0.com/t/login-issue-with-custom-domain-and-embedded-login/43213/7 "2020-05-18T22:34:01Z")

</div>

@karen.bermudez  
I changed the domain to: “[https://login.gdtr.biz](https://login.gdtr.biz)” and got the following:  
Issuer (iss) claim mismatch in the ID token, expected “login.gdtr.biz”, found “[https://login.gdtr.biz/](https://login.gdtr.biz/)”

---

<div class="post-metadata">

**Author:** ![karen.bermudez](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/karen.bermudez/32/28446_2.png) [@karen.bermudez](https://community.auth0.com/u/karen.bermudez)\
**Post date:** [May 18, 2020, 10:47pm UTC](https://community.auth0.com/t/login-issue-with-custom-domain-and-embedded-login/43213/8 "2020-05-18T22:47:43Z")

</div>

hmmmm, I wonder if it’s something about the Issuer configuration that is missing  
I found in here [Configure Features to Use Custom Domains](https://auth0.com/docs/custom-domains/additional-configuration#apis) that you _should validate the JWT issuer(s) against your custom domain_

I will keep searching about this specific error

Thank you!

---

<div class="post-metadata">

**Author:** ![robi1](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/robi1/32/12835_2.png) [@robi1](https://community.auth0.com/u/robi1)\
**Post date:** [May 19, 2020, 4:37pm UTC](https://community.auth0.com/t/login-issue-with-custom-domain-and-embedded-login/43213/9 "2020-05-19T16:37:02Z")

</div>

Hello @karen.bermudez

I updated my code and now I was able to set up my custom domain using the embedded login flow. However, when disabling third party cookies I’m getting this error {error: “access\_denied”, errorDescription: “Unknown or invalid login ticket.”, state: “SbGMg-h7K0Ix7gbPJFh-p7NAzTVNqXzZ”}. The reason why we paid for a custom domain was to convert third-party cookies into first-party cookies. Am I missing any configuration step?

---

<div class="post-metadata">

**Author:** ![robi1](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/robi1/32/12835_2.png) [@robi1](https://community.auth0.com/u/robi1)\
**Post date:** [May 21, 2020, 9:36pm UTC](https://community.auth0.com/t/login-issue-with-custom-domain-and-embedded-login/43213/10 "2020-05-21T21:36:18Z")

</div>

Hi @karen.bermudez,

Did you have the chance to look in to the issue related to the “Invalid login ticket” ?
