Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to authenticate without storing cookies in browser (Private Browser) #530

Closed
Tak783 opened this issue May 6, 2020 · 4 comments
Closed
Labels

Comments

@Tak783
Copy link

Tak783 commented May 6, 2020

How can I use use a private browser with App Auth?

Have been looking around in Issues, there is talk of SFSafariViewController with prefersEphemeralWebBrowserSession. I've also been reading of using OIDExternalUserAgent

cc @WilliamDenniss

@Tak783
Copy link
Author

Tak783 commented May 6, 2020

I've sen comment #209 (comment). It's not very easy to understand how to do this.

cc @WilliamDenniss

@Tak783
Copy link
Author

Tak783 commented May 7, 2020

Ok so using the standard auth methods I updated OIDExternalUserAgentIOS in the method presentExternalUserAgentRequest , where ASWebAuthenticationSession is used to have this line of code _webAuthenticationVC.prefersEphemeralWebBrowserSession = true; just before openedUserAgent = [authenticationVC start];

_webAuthenticationVC = authenticationVC; if (@available(iOS 13.0, *)) { _webAuthenticationVC.prefersEphemeralWebBrowserSession = true; } else { // Fallback on earlier versions } openedUserAgent = [authenticationVC start];
Would you be able to make this a feature option passed into the parameters such that we can log in using private browsing, please.

cc @WilliamDenniss, @julienbodet

@julienbodet
Copy link
Collaborator

@Guy783 This was previously discussed in #402. It is preferred to have dedicated user agents for each particular use case instead of making the existant ones customizable for every possible and imaginable use case. The good news is that AppAuth allows to implement your own custom user agent and it's really easy to do. William's comment gives some details on how to do it.

This section of the README is dedicated to Custom User Agents and gives some details about how to use and create them.

@Tak783
Copy link
Author

Tak783 commented May 13, 2020

Here's a link to an my example for an external agent in swift for anyone who would like a place to start. It is an ASWebAuthenticationSession with prefersEphemeralWebBrowserSession set to true.

And thank you @julienbodet

Based on William Denniss's Obj-C Gist

@Tak783 Tak783 closed this as completed May 13, 2020
@Tak783 Tak783 changed the title How to authenticate without storing cookies in browser How to authenticate without storing cookies in browser (Private Browser) May 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants