Enterprise iOS app MSAL SSO not working for internal webviews

Prasad More 1 Reputation point
2021-10-18T07:45:04.557+00:00

Hi,

I am developing an Enterprise native iOS app for my organisation.

I am using MSAL iOS SDK 1.1.19(microsoft-authentication-library-for-objc)

I was able to implement interactive and Silent login successfully by integrating SDK and following instructions on - https://github.com/AzureAD/microsoft-authentication-library-for-objc
and referring to Sample App in the repo.

I also followed the steps on -
https://learn.microsoft.com/en-us/azure/active-directory/develop/single-sign-on-macos-ios
to enable SSO in my app.
I set MSALWebviewParameters type as .authenticationSession for login in the app using SDK

But after login when I tried to access other internal organisation web apps through native webview, I was asked to login again with the account, even though I logged in to the app with my credentials just before.

SSO setup is failing somewhere for iOS, because same client ID, Authority, RedirectURI is used in the Native Android app with same bundle ID and it is working successfully in same scenario.

Any help, suggestions will be appreciated.

Microsoft Security | Microsoft Entra | Microsoft Entra ID
{count} votes

1 answer

Sort by: Most helpful
  1. Wenyan Zhang (Shanghai Wicresoft Co,.Ltd.) 36,441 Reputation points Microsoft External Staff
    2021-10-19T06:51:28.92+00:00

    Hello,

    Welcome to our Microsoft Q&A platform!

    According to this doc , we can see the system browser might still be a better option. Each WKWebView instance has its own cookie storage, it may lost cookie If you use different WKWebView instance in iOS. You could try to use Xamarin.Essentials: Web Authenticator, it enable users to sign in their existing Microsoft, Facebook, Google, and now Apple Sign In accounts.

    Best Regards,
    Wenyan Zhang


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.