question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Approaches to achieving a working logout on iOS

See original GitHub issue

Logout on iOS is problematic for us, due to additionalParameters: { prompt: 'login' } being ignored. I’m looking at the approaches I could take to get a working logout.

Previously, I had edited AppAuth-iOS to force the use of SFAuthenticationSession and then used react-native-safari-view to clear the authentication cookie. https://github.com/openid/AppAuth-iOS/issues/182, but these customizations were lost during our last update and look more difficult now since the pod is now being pulled automatically.

Some possible solutions I was looking at:

  1. Disable Pod install of AppAuth-iOS, include source manually and update as before.

  2. Fork this and update the code to allow implementation as per the gist here which changes AppAuth to always use the SFSafariViewController https://gist.github.com/WilliamDenniss/18f3779b4a310361bb955cf4e534f29c (https://github.com/openid/AppAuth-iOS/issues/209).

  3. Fork this and add an iOS only method which will call out to the signout endpoint on iOS only. The issue with this is it looks like it opens with a prompt stating sign-in which doesn’t look good. https://github.com/openid/AppAuth-iOS/issues/461

I am currently thinking approach 2 looks to be the best, if I’m missing anything or anyone has any better suggestions please let me know!

Related to https://github.com/FormidableLabs/react-native-app-auth/issues/68

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:5
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
jefhaicommented, Mar 31, 2020

+1 I’d really like to see this resolved… When I revoke tokens I want the ability to actually log the user out / clear their session. When I add additionalParameters to my config… it doesn’t even work.

0reactions
Jay-A-McBeecommented, Feb 4, 2022

Ending a user’s session through the Idp should now be supported on the latest version - 6.4.2. See endSessionEndpoint here and the logout method here.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Get Started with iOS Authentication using SwiftUI, Part 1 - Auth0
This tutorial will show you how to add authentication — or, more simply, login and logout — to a SwiftUI-based iOS app with...
Read more >
Login / Logout Flow: SwiftUI and EnvironmentObject - Paul Allies
When a user is logged out (isLoggedIn = false) at any point within the app, they are directed to the login page. Flow....
Read more >
What is the perfect way to make a logout from IOS app?
The below code is working but has a bug. The scenario is that, I begin by logging in to enter the app system....
Read more >
iOS App Logout via Universal Link Callback - GroundControl
This approach is independent of sign-on technology, and can be paired with simple username & password login, ASWebAuthentication, or other login ...
Read more >
Logout popup says 'Log in' instead of 'Log out' #461 - GitHub
No Describe the bug When you logout, the UIAlertViewController title says 'Wants to Use ... Approaches to achieving a working logout on iOS...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found