"callbacks must be a valid uri" when using package name with underscore

The app’s android package name is:

com.my_app.local://dev-aprmp-moretonblue.au.auth0.com/android/com.my_app.local/callback

notice that there’s an underscore in there, but when I do:

com.myapp.local://dev-aprmp-moretonblue.au.auth0.com/android/com.my_app.local/callback

it becomes valid. Notice that there is still an underscore on the second occurence of the package name, but not in first occurence.

I think this is a bug.

Hi - I’m 3 years too late but I just had this issue and found a work around so wanted to doccument it.
The tutorial says to use your bundle name as the scheme (first bit of the URL) but as you note underscores are invalid which is a problem if your bundle name has underscores. However you can configure the scheme to be anything to avoid this issue.

Looking at the xamarin tutorial here:

Under ‘Configure Callback URLs’ for the first instance of YOUR_ANDROID_PACKAGE_NAME, use your package name but replace the underscores with dashes. (or make it whatever you want it to be).

under ‘Handling the callback URL’ you configure the DataScheme. Instead of using your android package name, use your package name but replace the underscores with dashes again.

Then under ‘Trigger Authentication’ when you set up the Auth0Client manually set Auth0ClientOptions property RedirectUri to what you set in Allowed Callback URLs - with your bundle identifier’s underscores replaced with dashes.

Now you have configured your android app to have a valid scheme, and configured the urls and your client to use that valid scheme.

1 Like

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