I use WKWebView to display a webpage that requires authentication through an authentication provider. This works as expected, but when I close and reopen the app, I have to reauthenticate. However, if I open the same page in Safari, I only have to authenticate once. If I close Safari and reopen it, the page displays without prompting me to authenticate again. I see some cookies stored in httpCookieStore
, so I assume that storing cookies works. Does anyone have an idea why authentication is not persistent between app launches? Thanks in advance.
Best regards, Marc
It turned out that the website uses Microsoft Enterprise SSO for authentication and my app's bundle identifier must be added to the AppAllowList in our Entra ID configuration. Microsoft describes this in the Enable SSO for specific apps section of their KB article Microsoft Enterprise SSO plug-in for Apple devices. After adding the app to that list, everything worked as expected.