Using AuthSession to logout

#1

We’re using AuthSession to authenticate with our OpenID Connect provider and it’s been really easy to implement, so thanks for that! I’m working on implementing logout functionality now, and in the browser I’d send the browser to our auth server’s connect/endsession endpoint with the id token.

I’ve implemented this using WebBrowser.openAuthSessionAsync, which works, but Expo still displays the prompt “Expo wants to use “expo.io” to sign in” - which is an odd interface to present the user with when they’re logging out.

Am I going about this the right way, or is there a way to present a more intuitive experience to the user?

"expo.io" URL showing in iOS "Sign In" modal pop-up
#2

hi @pwise, the WebBrowser authSession is implemented so that the request initially routes to our expo.io auth servers, which performs the redirects to your specified url. This is why there is expo.io in the prompt. The sign in part in the prompt is because Apple hard codes this every time you open an SFAuthenticationSession.

To workaround this, you’ll need to setup your own servers instead of using our authSession. Our code is open source, so you can look at our code and bootstrap it for your implementation, if you want. Sorry there is not an easier way to do this.

https://github.com/expo/universe/blob/master/exponent/ios/Exponent/Versioned/Core/Api/EXWebBrowser.m
https://github.com/expo/universe/blob/master/exponent/android/expoview/src/main/java/versioned/host/exp/exponent/modules/api/WebBrowserModule.java

#3

Thanks for the reply! Your explanation makes sense. If you don’t mind, can you explain how you might go about implementing OAuth/OpenID signout in a mobile app?

This is new territory for me and I feel like I’m missing something obvious here because I don’t see anyone else on these forums asking this question.

closed #4

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