Oops!, something went wrong

We have integrated Auth0 swift SDK (pod ‘Auth0’, ‘~> 1.0’) in our iOS (Objective C and Swift) app. Some of our user are reporting the login issue. They are facing this issue on the Auth0 centralised login screen.
Attached screenshot can be referred for more details. We are not able to find the cause of this issue as only few of the user are facing this issue.

We are using below snippet for initialising Auth0,

Auth0
    .webAuth()
    .scope("openid profile")
    .audience("https://YOUR_DOMAIN/userinfo")
    .start { result in
        switch result {
        case .failure(let error):
            // Handle the error
            print("Error: \(error)")
        case .success(let credentials):
            // Do something with credentials e.g.: save them.
            // Auth0 will automatically dismiss the login page
            print("Credentials: \(credentials)")
        }
}


Hey there!

Although I’m not certain about the specific scenario that you described, I have seen this happen before with apps. Maybe the app was closed/hibernated whilst showing the login screen. Re-opening later could result in the login screen showing or refreshing without the proper flow or redirection from the App itself.

Regardless of the cause, I do believe this error screen can be avoided by using the Initiate Login Uri setting on an application config. What this does is, on a wrongfully triggered login attempt, instead of showing an error it would redirect to this Login Uri which you setup in your app that would then re-trigger the Authentication request.

Hope it helps!

2 Likes

Thanks for contributing to this one @rvdberg !

Hi @rvdberg,

Thanks for your quick response. It’s not about closing the app abruptly or something like that. The user’s who have reported the issue also told us that they have even tried uninstalling and installing the app again but the issue still persist for them. (For some of them, its complete blocker and for some its intermittent)

We have integrated Auth0 centralised login for two of our iOS apps and we have this issue for both the apps in production (iPhone and iPad). The challenge here is, this issue is for only a handful of users. There is no specific pattern like Device or OS version and since our team is not able to reproduce this issue at our end, we are not able to debug it.

Can you please explain more about the possible solution to this issue which you are suggesting in above comment.

Thanks in advance.

Sure thing! The part that I think will at least have Auth0 skip the error message is by setting a default login route: Configure Default Login Routes
That’s the Initiate Login Uri on the application config page.

Other than that, I don’t see any wrong config settings in your screenshot. You might already want to look into Refresh Token (offline_access scope) for mobile app usage.

Hi @morningstarmobiletea,

Did you ever find a solution to this issue? We’re experiencing the exact issue with a handful of our iOS users.

Thanks

Hi @rvdberg,

I’m curious about the default route configuration that you mentioned as we’re experiencing the same issue as @morningstarmobiletea.

I’ve confirmed that we don’t currently have a default login route configured but its unclear to me what the Initiate Login Uri value should be for a mobile app that is only using the Auth0 SDK.

Thanks in advance!

Hey @gspears!

The ‘default route’ is an url for your app (whether it’s Native or Web), that results in the app directly calling (redirecting) towards the Auth0 /authorize endpoint.

In the case of a native app, this would be a link that is handled by the app instead of browser (deeplink).

It won’t really have a relation with an Auth0 SDK, it’s merely a url that you can visit and end up correctly at a login screen. (Or if you already have a valid session, seamlessly enter the application).
So you can use any url you want, as long as you handle it in your code and trigger the Authorize.

Best,
Rutger