We are using Azure AD as OIDC Identity Provider in AWS Cognito.
In iOS side, we use ASWebAuthenticationSession
to show a web view and let the user login. User can login successfully but the issue is when opening Safari browser in the iPhone and going to the user’s Microsoft account, the user needs to input his/her credentials.
Notes:
prefersEphemeralWebBrowserSession
is set tofalse
- We’ve tried to use older APIs such as
SFSafariViewController
andSFAuthenticationSession
- We have our own Authorization and SSO is working between our app and Safari.
Anything we’re missing for SSO to work between our app and Safari app?
2
Answers
It seems SSO depends on a couple of things
Found this very useful blog from Okta that summarizes cookies sharing between Safari app,
SFSafariViewController
,SFAuthenticationSession
,ASWebAuthenticationSession
.You should be able to create a link with the authorization token for Microsoft, then redirect your app to open the link in safari. The iPhone will leave your app to open the auth link including the token.
Then if you leave your app, you would have loaded the auth info into safari for use outside your app.