capacitor-community / generic-oauth2

Generic Capacitor OAuth 2 client plugin. Stop the war in Ukraine!
MIT License
234 stars 115 forks source link

ASWebAuthenticationSession Support? #122

Open xcskier56 opened 4 years ago

xcskier56 commented 4 years ago

Description

Does this plugin support using ASWebAuthenticationSession? I know that OauthSwift, which this plugin is using does, but in my testing, it seems that a regular Safari View is used instead of the ASWebauthenticationSession. I'm a web dev so only moderately understand the swift code, but it appears to me that a SafariURLHandler is being used instead of the ASWebauthenticationSession. Is this the case?

phal0r commented 3 years ago

What is the advantage of ASWebAuthenticationSession @xcskier56 ?

moberwasserlechner commented 3 years ago

I for my part can not answer this question either.

@xcskier56 please explain the advantages of ASWebAuthenticationSession.

I keep this issue open a few days and close it afterwards if there is no feedback.

BR

phal0r commented 3 years ago

I did some investigation and ASWebAuthenticationSession should be used as it is more secure and provides better usability by sharing cookies and password autocompletion.

See: https://authguidance.com/2020/02/22/ios-code-sample-overview/

Also, I think it is correct, that OauthSwift has support for ASWebAuthenticationSession and this should be the default way to initialize a OAuth2/OIDC Login.

Can this somehow be made configurable @moberwasserlechner ?

doublechecker commented 2 years ago

Hey there. This is quite important because we already had some trouble with Apple App Review. Sometimes they reject our app because we do not use the desired way of ASWebAuthenticationSession. When ASWebAuthenticationSession is used there is an alert asking the user if the app should open a authentication-session (see screenshot as example). We would really appreciate this feature as it is implemented in the underlying plugin already. 33736712-3d3deaf4-db59-11e7-9336-552df2fc092d

LucaBlackDragon commented 1 year ago

moreover, this feature would allow to achieve Single Sign On between two or more different apps (provided they all talk to the same OIDC provider)

sampaxk commented 1 year ago

I've created a pull request that allows the plugin to support ASWebAuthenticationSession. Here is it: #226

otrebu commented 5 months ago

Just wondering why the PR it is not merged...