AppAuth uses SFAuthenticationSession to achieve SSO in iOS 11. This is the Apple supported way of implementing SSO on iOS 11.0+. Unfortunately, SFAuthenticationSession seems to be buggy, and SSO does not work consistently (https://twitter.com/rmondello/status/887434621989789696).
Navigate to Examples > Example-iOS_Swift-Carthage. Run carthage bootsrap and launch Example.xcodeproj.
Change the bundle identifier to be unique and create a project in Google Developer Console, going through the steps to create credentials for OAuth.
Change the kIssuer, kClientID, and kRedirectURI strings in the example code appropriately using the client ID string generated in the Google Developer Console.
Add the scheme of the redirectURI to the info.plist URL Schemes.
Repeat steps 1 – 5 using a different bundle identifier for the second project.
Testing
Install both apps on test device running iOS 11.0+.
In the Settings app, find Safari and press the “Clear History and Website Data” button.
Open the first app and press the “1. Auto” button and press “Continue” on the pop-up option
Sign in using a google account
Open the second app and press the “1. Auto” button and press “Continue on the pop-up option.
Expected Behavior
When the sign in page pops up in the second app, a page displaying the message “Choose an account” is shown with the account you just signed in with in a list. When you select the account, you are redirected back to the app and don’t have to type the password, having successfully signed in using SSO.
Actual Behavior
When the sign in page pops up in the second app, behavior is inconsistent. Sometimes it has the expected behavior and SSO works. Other times the sign in page pops up as if you never signed in before, and you have to reauthenticate in the second app.
AppAuth uses SFAuthenticationSession to achieve SSO in iOS 11. This is the Apple supported way of implementing SSO on iOS 11.0+. Unfortunately, SFAuthenticationSession seems to be buggy, and SSO does not work consistently (https://twitter.com/rmondello/status/887434621989789696).
I am seeing the same behavior as reported in https://github.com/openid/AppAuth-iOS/issues/186.
Steps to reproduce bug:
Set Up
Testing
Expected Behavior
When the sign in page pops up in the second app, a page displaying the message “Choose an account” is shown with the account you just signed in with in a list. When you select the account, you are redirected back to the app and don’t have to type the password, having successfully signed in using SSO.
Actual Behavior
When the sign in page pops up in the second app, behavior is inconsistent. Sometimes it has the expected behavior and SSO works. Other times the sign in page pops up as if you never signed in before, and you have to reauthenticate in the second app.