Logout is not working for logout google in IOS

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 (https://auth0.com/docs/api/authentication?http#logout https://auth0.com/docs/logout/guides/logout-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?


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.

Sidharth Chaudhary

1 Like

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

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:


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

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:


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