Skip to content

Forcing the user to enter their username and password again #281

Description

@mattio

Is your feature request related to a problem? Please describe.
Our app has an activity timeout. After you successfully login with your username and password and begin using the app, if you're inactive for 2 minutes, we display a "lock" screen prompting the user to login again. If you minimize the app and then open it again later, we also display that screen if it's been longer than 15 seconds.

Logging in works fine. API access with the tokens works fine. Re-displaying the lock screen works fine. My problem, I believe, is session cookies -- more precisely my inability to clear them. When the user taps the login button again, the SFSafariViewController or SFAuthenticationSession UI appears, and the provider endpoint starts to load. It sees the cookies and automatically redirects the user back into the app, giving the user access.

For this scenario, we don't want that automatic login and redirect. What I'm being asked to do is to force the user to enter their username and password again.

Describe the solution you'd like
What I'd like I know I can't have. ;-) I'd like for SFSafariViewController and SFAuthenticationSession to allow me to clear cookies for my app.

Describe alternatives you've considered
I've tried calling the token revocation endpoint but that doesn't seem to impact the session cookies.

The only other alternative I've come up with is using the end session endpoint. I haven't been able to get it fully working yet, but I was thinking I might be able to call the end session endpoint immediately before sending the user to the login screen. Unfortunately the user experience for that seems like it's going to be terrible. If my understanding is correct, I'd have to call to end session properly so there is no confirmation prompt on the logout screen, redirect back into the app, close that SFSafariViewController or SFAuthenticationSession screen, then open another with the login endpoint. Yikes.

Is there some other way to get this scenario to work?

Additional context
We use IdentityServer.

The remember me checkbox feature is not being used for this scenario.

I do see the work going on in #259, too. Looking forward to that feature as well!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions