0

When I access my WebApp on iOS devices, it causes redirection back to login page from home page, after signing in.

Like, AAD Login -> WebApp homepage(redirects to login) -> AAD Login -> WebApp homepage(properly logged in with no further redirection, at this point). It always signs in properly after second sign in, as shown.

WebApp works fine on Android and Windows without redirection problem.

I would appreciate if anyone can provide input on this. Thank you.

Sarahrb
  • 407
  • 11
  • 24

1 Answers1

0

• I would suggest you to please check the ‘[BUNDLE_ID]’ value you have used from the Azure portal. It should be ‘com.microsoft.identitysample.MSALiOS’ as the bundle identifier in ‘info.plist’ file. Once done, then please refer to the below link for more details regarding the sign-in callback link in ‘AppDelegate.swift’ file.

https://learn.microsoft.com/en-us/azure/active-directory/develop/tutorial-v2-ios#for-ios-only-handle-the-sign-in-callback

• Also, please check the redirect URI in Azure AD whether it is in ‘msauth.[Your_Bundle_Id]://auth’ format or not. The default redirect URI format works for most apps and scenarios, including brokered authentication and system web view. Use the default format whenever possible. Ensure that the redirect URIs configure in Azure AD for iOS follow MSAL redirect URI format requirements as given in below documentation: -

https://learn.microsoft.com/en-us/azure/active-directory/develop/redirect-uris-ios#msal-redirect-uri-format-requirements

• Finally, please check whether the ‘internetChanged’ method is getting called in your scenario. If for your application, the ‘viewController’ is shown, then there is a logic for loading in the webview UI regarding the redirection from login page to home page and back. Please check the thread below for more information: -

Web app auto-redirecting to the initial page on iOS problem (it should NOT redirect)

Kartik Bhiwapurkar
  • 4,550
  • 2
  • 4
  • 9
  • Thank you for the detailed reply. Mine is a web application (which is being accessed on iOS and android thru browser). It is not a native mobile app. I am using 'web' tile in add a platform(not iOS/ macOS). So I have never configured for iOS bundle ID. Do you still advice me to follow the suggestions? thank you. – Sarahrb Feb 17 '22 at 15:06
  • 1
    I would suggest you to please check the below links for information on your issue: - https://stackoverflow.com/questions/52544576/azure-active-directory-safari-redirection-issue and https://support.apple.com/en-in/HT203370 – Kartik Bhiwapurkar Feb 21 '22 at 06:40
  • Thank you for the links. I tried both of them already but problem still exists. Maybe my cookies are not set properly. I would appreciate if you have any input on this - https://stackoverflow.com/questions/71195352/samesite-cookie-setting-for-redirection-problem – Sarahrb Feb 21 '22 at 12:32