p2 / OAuth2

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

Alamofire retrier reverting to Safari when using an embedded view #287

Closed riverbaymark closed 6 years ago

riverbaymark commented 6 years ago

Greetings!

So the redirect url from the API I am using is of type https. For this reason I must use an embedded view controller (and forbid Safari) in order to capture the redirect. I would love to implement the retrier with AlamoFire, but the issue is when it performs the retry and attempts to authorize, it defaults back to a Safari view and thus I can no longer capture the redirect.

Any suggestions would be greatly appreciated!

Mark

riverbaymark commented 6 years ago

Ok found the secret sauce to make it work. Just be sure to include the following before your request using the retrier:

    retrier.loader.oauth2.authConfig.ui.useSafariView = false
    retrier.loader.oauth2.authConfig.authorizeEmbedded = true
    retrier.loader.oauth2.authConfig.authorizeContext = self

Closing this now.