SFSafariViewController is not returning to iOS app

Sumit Kumar 5 Reputation points
2024-02-25T03:16:23.73+00:00

Hi, I am working on the MSAL SSO login when I set the .safariViewController in webViewParameters and try to login then it is not returning to the iOS App, it just show DONE button on SafariViewController. I have also checked the other thread and everyone is saying that we need to use below line := func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool {
print("Received Callback in App delegate (options) (url)")
return MSALPublicClientApplication.handleMSALResponse(url, sourceApplication: options[UIApplication.OpenURLOptionsKey.sourceApplication] as? String)
}

I have also added above code and my redirect url is also correct but still it is not working.

Can anyone help me on this issue. Code : = self.webViewParameters = MSALWebviewParameters(authPresentationViewController: self)
self.webViewParameters?.webviewType = .safariViewController
self.webViewParameters?.presentationStyle = .fullScreen info.plist:==

<key>CFBundleURLTypes</key>
   <array>
   	<dict>
   		<key>CFBundleURLSchemes</key>
   		<array>
   			<string>msauth.$(PRODUCT_BUNDLE_IDENTIFIER)</string>
   		</array>
   	</dict>
   </array>
   <key>LSApplicationQueriesSchemes</key>
   <array>
       <string>msauth</string>
   	<string>msauthv2</string>
   	<string>msauthv3</string>
   </array>
Microsoft Security | Microsoft Entra | Microsoft Entra ID
Microsoft Security | Microsoft Identity Manager

2 answers

Sort by: Newest
  1. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.

    2 deleted comments

    Comments have been turned off. Learn more

  2. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

Your answer

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