Custom domain not working react-native

Hi all,
while building an app with react-native 0.58.4 and react-native-auth0 1.4.0, we want to use our custom domain to show a custom prompt message for the iOS dialog, as stated here: iOS Swift - Remove consent dialog social login with auth0 - #7 by Abhishek_Hingnikar1

we are calling something like:
auth0.webAuth.authorize({ scope: 'offline_access openid profile email', prompt: 'login', audience:https://${config.auth0.domain}/userinfo })
where config.auth0.domain holds our custom domain. So far so good, the dialog now displays our custom domain. Then we proceed to complete the login flow with the in-app browser and in the first time we get the message of a missing callback url, which makes perfect sense.
But after configuring the callback in the dashboard to {YOUR_BUNDLE_IDENTIFIER}://${AUTH0_CUSTOM_DOMAIN}/ios/{YOUR_BUNDLE_IDENTIFIER}/callback
the in-app browser open and closes itself right after. The error is a0.response.invalid: unknown error

Any help is appreciated.
thanks!

Unsure if this will the sole responsible for the problem, but if config.auth0.domain holds your custom domain then you should NOT use it to dynamically build the audience for the /userinfo endpoint.

The audience for the endpoint above is a static identifier that happens to use the Auth0 tenant domain to make it unique and associated with your tenant, however, this is an identifier that does not support having the tenant domain part replaced with the custom domain.

In this particular case, if your client application is already configured to be OIDC conformant you might even be better by not sending an explicit audience. You should make this change and see if you still experience issues.

2 Likes

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.