SSO between mobile app and web app using same auth0 user account

I have an Auth0 application that has a mobile web app and a mobile native app (origins,callbacks,etc). The user has to log into either one separately.
Can a user log into the mobile app and click a button to open the web app and have it log into the web app like SSO? It would be a better user experience not to have to log in separately.

If your mobile app uses a browser based flow (and shares cookies with the web app browser) you get SSO for free.

John

They both use same universal login. On mobile side it did require a Browser plugin for capacitor.
I just don’t know home to pass the cookie on mobile to the external web app.

Hi @donniekerr01

At a guess, you are using an embedded browser, and that doesn’t share cookies with the system web browser. If that is the case, you’ll need to switch to using the system web browser for login.

John

You are correct, the capacitor browser was required to make it a seamless experience for the user of auth0 in native app.

I figured it couldn’t share the cookie to external browser. Just wasn’t sure if there was a way to acomplish something like SSO between them since they use same auth0 app.
Appreciate the help

Hi @donniekerr01,
you’ve probably found a solution a long time ago, but I’d like to share mine as it might help others struggling with this.

I’m building a Flutter mobile app and using the auth0_flutter lib to do the auth. To get SSO working, on iOS, I set the auth0 sdk to do the auth flow in a SFSafariViewController and then opened the web app that was supposed to use that session in a SFSafariViewController as well.

On Android, I ran the auth flow in Custom Chrome Tabs (the default in the auth0 Flutter sdk) and then the external browser (Chrome) did pickup the session.

Cheers,
Marcin

1 Like