@Sumit Kumar
From above description and comments I could see that you have already been using the application(_:open:options:) method in AppDelegate which is required for Controller to return to the app.
Kindly validate the following checks and confirm if this helps you.
- Check the redirect URI in your MSAL configuration to make sure it matches the URI scheme of your iOS app. You can find the URI scheme of your app in the Info.plist file under the URL types section.
- Make sure that you are dismissing the
SFSafariViewController
in the completion block of theacquireToken
method. For example:
application.acquireToken(with: tokenParameters) { (result, error) in
if let error = error {
print("Error acquiring token: \(error)")
return
}
if let result = result {
print("Access token: \(result.accessToken)")
// Do something with the access token
}
// Dismiss the SFSafariViewController
self.dismiss(animated: true, completion: nil)
}
- Kindly validate the version of MSAL you have been using try to use the latest one and confirm the behavior.
Please "Accept the answer (Yes)" and "share your feedback ". This will help us and others in the community as well.
Thanks, Akshay Kaushik