-
Notifications
You must be signed in to change notification settings - Fork 773
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for other browsers on iOS #200
Comments
- An UICoordinator for iOS to support auth with a custom iOS browser like Chrome or Firefox. - Implements openid#200.
- An UICoordinator for iOS to support auth with a custom iOS browser like Chrome or Firefox. - Implements openid#200.
- An UICoordinator for iOS to support auth with a custom iOS browser like Chrome or Firefox. - Implements openid#200.
- An UICoordinator for iOS to support auth with a custom iOS browser like Chrome or Firefox. - Implements openid#200.
- An UICoordinator for iOS to support auth with a custom iOS browser like Chrome or Firefox. - Implements openid#200.
- An UICoordinator for iOS to support auth with a custom iOS browser like Chrome or Firefox. - Implements openid#200.
- An UICoordinator for iOS to support auth with a custom iOS browser like Chrome or Firefox. - Implements openid#200.
- An UICoordinator for iOS to support auth with a custom iOS browser like Chrome or Firefox. - Implements openid#200.
- An UICoordinator for iOS to support auth with a custom iOS browser like Chrome or Firefox. - Implements #200.
This 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)
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 AppAuth-iOS/Examples/Example-iOS_ObjC/Source/AppAuthExampleViewController.m Lines 215 to 218 in 135f99d
Change it to:
As you can see, with the latter code block we are creating the external user-agent object 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:externalUserAgent: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. Update 2018-03-07: This post was edited to reflect the recent renaming of UICoordinator to ExternalUserAgent. |
@WilliamDenniss Mind adding how-to notes to the main Readme? It's not really visible that this feature exists there. |
In due course. This only just landed in HEAD, needs an example too ideally. |
Will this change also allow consumer apps to login without SSO ? |
Working with safari but not with chrome.. |
@munderk please file a bug report if you're experiencing an issue. |
For the record, I just tested AppAuth's custom browser support with Chrome (v67.0.3396.87) on iOS 11.4.1, following these instructions, and everything worked as expected. |
To support "enterprisy" use-cases like those encountered by the NCCoE's Mobile SSO effort, it would be useful to include support to process the OAuth request in alternative user-agents on iOS such as Chrome and Firefox.
These external user-agents may support additional features like U2F which are required by some enterprise environments.
This feature would be specifically for environments where you can control what apps users have installed (such as an enterprise workplace). Consumer apps should continue to use the existing in-built external user-agents (i.e. the various incarnations of Safari) supported by AppAuth.
AppAuth already abstracts away the
UICoordinator
to handle requests in the user-agent to support browsers on different platforms, so this functionality could simply be provided as an alternative implementationUICoordinator
on iOS.The text was updated successfully, but these errors were encountered: