Hiding the auth.expo.io redirecting page

Hello,
I am using expo auth-session service.
When the in app browser is initiated, before redirecting to my login page, the following page is presented for a few seconds:

It bothers my client and I wonder if there is a way to control this page so I can render a more user friendly message with my customer’s logo and brand.

Hey @guy1812,

You can pass in some options to promptAsync to configure this. https://docs.expo.io/versions/v37.0.0/sdk/auth-session/#authrequestpromptoptions

It also will probably be worth reading this https://docs.expo.io/versions/v37.0.0/sdk/auth-session/#what-authexpoio-does-for-you if you haven’t already.

Cheers,
Adam

Hey @adamjnav,
Thank you for your reply.
Using promptAsync requires upgrade expo-auth-session to 1.3.1.

  • I am using expo 37.
  • Node 12.14.0.
  • Attempt to use “expo upgrade” leaves me with expo-auth-session@1.2.1 which does not know of promptAsync.
  • Attempt to change package.json to expo-auth-session to 1.3.1 and then remove all node_modules and reinstall then rerun show error on load (before even calling AuthSession):
    Unable to resolve module 'assert' from 'node_modules/expo-auth-session/build/QueryParams.js': assert could not be found within the project.
    I think it is related to linking.
  • Attempt to run expo install expo-auth-session@1.3.1 leaves me with expo-auth-session@1.2.1.

Can you assist me here?

Hey @guy1812,

I’m going to route this to the team member who has worked on auth session most recently and see if we can get this sorted. I can confirm that I got the same assert error when adding 1.3.1 to a new project.

1 Like

Looks like assert is a missing dependency, you can install it with yarn add assert.

I’ve also open a PR to remove the dependency altogether: https://github.com/expo/expo/pull/8934 will be publishing later today.

1 Like

The latest version expo-auth-session@1.4.1 has assert removed.

@bacon
I am going by your example: https://github.com/expo/examples/blob/master/with-auth0/App.js
But since Im writing with typescript:

  1. AuthSession.useAuthRequest 's first parameter has a responseType key - on your example you used a string but it’s required type is AuthSession.ResponseType and it’s enums options are “Code” or “Token”. and I need “id_token”.
  2. The second parameter is of type AuthSession.DiscoveryDocument where “tokenEndpoint” and “discoveryDocument” are required as well. From your example it looks like the required flags are not necessary?
    Thanks

I am correcting my above reply:

  1. AuthRequest.ResponseType does have IdToken key. it was only the expo docs that are not updated: https://docs.expo.io/versions/latest/sdk/auth-session/#responsetype
  2. Same with Discovery document. while the code does not state it, the docs are describing required fields: https://docs.expo.io/versions/latest/sdk/auth-session/#discoverydocument

it’s working,
Thanks guys

1 Like

Glad to hear that! Thanks for your patience.

So without the Proxy, I had to add “exp://10.0.0.4:19000” to my allowed callbacks list on auth0 platform.
It works well locally, but I am not sure how to make my production app to work.
On production app (not on expo mobile app) the callback is kbp:// (app scheme).
But I cant add this kind of uri to auth0 platform.
I understand that this is the great value the proxy provides, but my client doesn’t want to see the redirection page on every login.

  1. Any guidance on how to make it work?
  2. let’s say I make the redirect url to be something like: “https://app.kb-pure.co.il/”, how do I make this site to get the payload with the user data post login and pass it as part of the deep link back to the app?
  3. If I have to work with the proxy, can I customize it’s html when showing the “redirecting you” page?

This is the view my client doesn’t want to see.
adding to the above questions:
4. I have asked the auth0 community why can’t I add “kbp://” as allowed callback and they said its possible only as “kbp://CALLBACK_URL”, but when I tried to add it it didn’t work (still got the “callback not allowed” on the auth0 universal login)


@bacon asking you because of the expo-auth0 example you made. Do you know how to make it work for standalone app without the proxy?

Trying again to maybe find answer to my questions here

I’m trying to achieve the same thing here, I found other forum posts about “implementing your own custom server” as an answer but not really sure what that entails or how to go about it. Also working with Auth0

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