Universal login web view disappears on iOS

Hey there, I am building an iOS/Android app using React Native and currently just targeting iOS to get Auth0 working.

I’ve followed the React Native tutorial from Auth0 and succeeded in showing the universal login screen in a safari web view.

I logged in successfully. On subsequent attempts to display the universal login page, the web view pops up briefly (the title bar indicates my auth0 domain, which then is replaced by text “Website name”), and then the web view disappears again (no content displayed).

I wondered if this is due to the fact that I am already authenticated. I tried changing the jwt expiration on my profile (but perhaps I already have a long-lasting token). However, I logged in over ten hours ago and the login screen still does not appear (as though I’m logged in already). I have run a project clean in Xcode. I have erased the simulator’s content and settings. Still not getting things to reset.

I just wish I understood what is going on and the documentation won’t help me. In all of my experimenting with auth0 I have changed bundle identifiers and restarted my computer, and every once in a while I get back to a fresh, unauthenticated (and non-erroring) state, and the login screen displays. But I haven’t been able to isolate the variables and I’d like to know if anyone knows what this behavior indicates?

The simplest explanation to that would be the one you hinted to; there’s an already existing session so the request completes without end-user interaction. This session is based on cookies within the browser session so for a universal login flow it would be session cookies within the system browser (Safari).

If you want to always show the login user interface again in a native application because the end-user may have multiple accounts and wants to login with a different one you can include the parameter " prompt": "login" in the call to the authorize method.

The inclusion of prompt=login in an authentication request instructs the service to show a login page even if a session already exists. Having said that, it’s weird that resetting the simulator did not clean the session so there may something else going on, however, I would still do the test with the parameter above as that is simple to perform and improve the situation.