auth0-extensions / auth0-account-link-extension

An extension aimed to help link accounts easily
MIT License
28 stars 76 forks source link

When linking account, issuer is not my custom domain #161

Open ajubin opened 1 year ago

ajubin commented 1 year ago

Hi,

I've got a custom domain on my auth0 instance and I use it in my app to verify the token.

As a user, when I want to link account by clicking on "Continue", I'm redirected on the default domain login page.

Hence, the token generated when the account are linked is not issued as the custom domain but as the default one.

So my app fails authenticating the user with the token, throwing the error: Issuer (iss) claim mismatch in the ID token; expected "<CUSTOM_DOMAIN>", found "<DEFAULT_DOMAIN>"

My workaround is to catch this error message and do another login flow As I didn't find any way to configure the account link extension to go on my custom domain page

I'm not sure someone from the repo will read this, but hopefully it may help someone

ajubin commented 1 year ago

I guess the other solution is to implement myself the User Initiated Linking by following this example https://auth0.com/blog/improving-the-sign-in-with-apple-experience-with-account-linking/ or that one https://auth0.com/docs/manage-users/user-accounts/user-account-linking/user-initiated-account-linking-client-side-implementation

rlewis-grax commented 1 year ago

@ajubin See this section of the extension documentation, which states:

If you're using a custom domain, you'll need to set the configs rule customDomain with the custom domain (for example, auth.custom.com).

  1. Go to Auth0 Dashboard > Auth Pipeline > Rules.
  2. By default, line 27 of the rule is: issuer: auth0.domain You will need to change this to: issuer: "myCustomDomain.com" Make sure to omit the protocol portion of the URL.
TomFCarrion commented 3 months ago

@rlewis-grax Rules are deprecated now. I couldn't find a way of implementing it using an action. Any idea on how to archive it?

image