Custom Browser support for AppAuth for iOS has been implemented. Here's how to configure AppAuth to use a custom browser:
First, add the following array to your Info.plist (in XCode, right click -> Open As -> Source Code)
<key>LSApplicationQueriesSchemes</key>
<array>
<string>googlechromes</string>
<string>opera-https</string>
<string>firefox</string>
</array>
This is required so that AppAuth can test for the browser and open the app store if it's not installed. You only need to include the URL scheme of the browser you intend to use.
Then tweak your call to authStateByPresentingAuthorizationRequest
Change it to:
OIDAuthorizationUICoordinatorCustomBrowser *coordinator =
[OIDAuthorizationUICoordinatorCustomBrowser CustomBrowserChrome];
appDelegate.currentAuthorizationFlow =
[OIDAuthState authStateByPresentingAuthorizationRequest:request
UICoordinator:coordinator
callback:^(OIDAuthState *_Nullable authState, NSError *_Nullable error)
As you can see, with the latter code block we are creating the UI coordinator manually and using it, rather than using the default. This technique can be used with the automatic code exchange of OIDAuthState (as shown above), and manually with OIDAuthorizationService:presentAuthorizationRequest:UICoordinator:callback:.
That's it! With those two changes (which you can try on the included sample), AppAuth will use Chrome iOS for the authorization request (and open Chrome in the App Store if it's not installed).
Chrome, Firefox, Opera Mini and Safari are supported out of the box, however it's quite simple to support more browsers without changes to AppAuth, by following the patterns used for the included browsers.