p2 / OAuth2

OAuth2 framework for macOS and iOS, written in Swift.
Other
1.14k stars 275 forks source link

Avoid using SafariViewController when token expires #418

Open mmoosbac94 opened 4 months ago

mmoosbac94 commented 4 months ago

Hello everybody,

we currently have the issue that we have to avoid the use of safari services. Our goal is to use the os standard browser for authentication. Its working when we first authorize via "oauth2.authorize()". But if the token expires, the SafarViewController is shown for new authentication. Is there a way to not use the SafariViewController and use the os standard browser instead for a new authentication as well?

Thank you

ossus-lib commented 4 months ago

Even if authorizeEmbedded is set to false?

mmoosbac94 commented 4 months ago

Yes, and when we start the app its working. The standard default browser will be opened. But if the token expires and there is no refresh token and I am in app, then the Safari Viewcontroller is shown instead of the browser. We already tried different advanced settings from documentation but without success.

ossus-lib commented 4 months ago

Can you reproduce with a debug logger and paste the logs here?

oauth2.logger = OAuth2DebugLogger(.trace)
mmoosbac94 commented 4 months ago

We tried to get some logs, but the authorization function is not called again when token expires. So when token expires there are no visible p2/oauth2 specific logs. We are using a so called ArcGIS SDK. We are not sure if this SDK is responsible for showing the SafariViewController.