openid / AppAuth-iOS

iOS and macOS SDK for communicating with OAuth 2.0 and OpenID Connect providers.
https://openid.github.io/AppAuth-iOS
Apache License 2.0
1.72k stars 744 forks source link

What is `presenting` in this API? I know it's a view controller but there is no explanation of what this VC is? #835

Closed oliverfoggin closed 3 months ago

oliverfoggin commented 3 months ago

In the APi...

currentAuthorizationFlow = OIDAuthState.authState(byPresenting: request, presenting: self)

It isn't clear what the presenting view controller should do? Or what it is used for?

I thought the framework presented a SFSafariViewController for the login flow?

For clarification... I'm building this into a SwiftUI app so there is no self to pass in here. And further, I'm building it in a dependency that has no UI as building this directly in the UI does not seem like a good way of building testability into it.

oliverfoggin commented 3 months ago

Ah, in the end I had to reach into the UIApplication and extract the root view controller from the various scenes and windows.