简体   繁体   中英

Azure active directory ioS redirection issue

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.

• 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 'inte.netChanged' 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)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM