Logout is not working for logout google in IOS

Hi
I’ve added a feature in my IOS app to login the user through google. So when user login, I save all the tokens in keychain and when user tries to logout I clear the keychain like keychain.clearAll().
But it still pick the last logged in user credentials on next login and user could not see google login page.
I’ve also implemented logout API (Authentication API Explorer Log Users Out of Auth0) but its not working as well. I’ve one more question that when we call this login api then there is no user token information of header specified in documentation for which we wants to logout the particular user. So how we will call this API to make the logout success for current particular user?

Regards
Saba

1 Like

Hey @saba.anwar,

Usually to logout from the IDP you need to add “federated” query parameter to the
logout request. Please find more information below:

For an iOS app with Auth0 swift SDK it will just need to change the federated option to true in the .webAuth().clearSession(federated: true )

Implementation details may vary according to the SDK used.

Regards,
Sidharth Chaudhary

1 Like

What other configurations do I need because I’m having error on Auth0
.webAuth().clearSession(federated: true) { (success) in
print(“success”)

Plus its opening the browser too when I call Auth0
.webAuth().clearSession(federated: true) and it does not seems good in app that when user press logout button, its opening browser and display the above attached image

@saba.anwar, the error seems to be due to your returnTo string not added in the callback “Allowed Logout URLs”. Can you add it in the “Allowed Logout URLs” setting in your application and try again.

I’ve successfully implemented Auth0
.webAuth().clearSession(federated: true) and configured “Allowed Logout URLs” from the auth0 docs:
Go to your Dashboard Settings and make sure that the Allowed Logout URL field contains the following logout callback URL:

{PRODUCT_BUNDLE_IDENTIFIER}:domain/{PRODUCT_BUNDLE_IDENTIFIER}/callback

but its opening browser when user taps on logout button and displaying message that my app wants to use “Auth0.com” to sign in which is looking totally weird on sign out feature. When we click on allow it display the google account screen and user have to cancel that.
So there are 2 things, first if browser must need to open to clear cache then let me know the way to customize that message that asking user for sign in on sign out feature.


Secondly, why it don’t close itself the next google account screen.

Anybody there? I need to fix this issue for my app

@saba.anwar,
Please have a look at this community post for the redirect behaviour of the Google social connection.

Underlying problem is google unfortunately doesn’t support redirect after logout:

https://stackoverflow.com/questions/4202161/google-account-logout-and-redirect

1 Like

@sidharth.chaudhary its for redirect issue. What for my problem that its displaying sign in alert on signout.

@Auth0 support staff, my client is really frustrated from this issue that displaying sign in alert on sign out!
Its a long time that I’m having this issue but could not find any solution. Also looked into many posts but I think no one had found any solution like

My client is using free account and he will obviously will not buy your services if you guys has these major issues in basic features

1 Like

Yea… Auth0 team, could you just make an if statement that changes “sign in” to “sign out” ?

Do you have an open source version of your code? I’ll do it. This seems like a big issue to a lot of people with a simple fix. Sure the dialog box must stay, that’s Apples thing, but the word “in” v. “out” is that Apple too?

2 Likes

Hey there @tristanb.newman!

Unfortunately, as far as I can tell Auth0 has no control over the actual text in the alert. Please see the following:

If you still believe this to be an issue, please don’t hesitate to open up a GH issue against the SDK itself and let us know here if you can.