A problem was fixed by Microsoft Team. Now the issue doesn't reproduce
MSA authorization flow stuck on iOS after returning back from MS Authenticator
We integrated MSA authentication flow on iOS that based on WKWebViewController. Sometimes auth flow in browser stuck after approval and switching back from MS Authenticator
How to reproduce:
- Open authorization url at https://login.microsoftonline.com/<UUID>/login
- Enter a login and a password. A push notification from MS Authenticator is coming
- Switch to MS Authenticator app, our app goes into background mode
- Confirm authorization request in MS Authenticator
- Return back to our app
Actual result:
Sometimes we still see in browser "Approve sign-in request". There is neither redirect to the the success page neither a message with approval timeout error. Authorization flow stuck
Expected result:
We expect further processing to the success page
After debugging of WebView with Safari developer tools, some facts were investigated:
- The webpage is polling https://login.microsoft.com/common/SAS/EndAuth from
SessionApprovalViewModel.js
method_callEndAuth()
- When the response fails, polling is stopped. The response may fail when the app is switching to background mode, all active connections are terminating in iOS
- If consider more details in
PollingHelper.js
in_pollAsync()
method we see the polling of resource bysetInterval
. If any error was catched and it's not an instance ofPollingHelper.RetryableError
, thestopPolling()
is calling.
Looks weird, polling should be continued even after errors. Currently it causes a critical bug on iOS when switching to background with the active request, which fails after returning back in browser.
The similar problem is described in comments by @Eric Peterson in https://learn.microsoft.com/en-us/answers/questions/946491/microsoft-login-not-able-to-receive-response-from.html but no answer still
3 answers
Sort by: Most helpful
-
-
Gertjan Smits 1 Reputation point
2023-01-10T10:36:17.23+00:00 Did you ever find a solution for this? I'm facing the same issue with our apps.
-
Andrei Iarosh 11 Reputation points
2023-01-10T12:01:46.717+00:00 Hello, Microsoft Team. Could you please fix the bug on your side?
You're polling EndAuth endpoint, but if any error in response was received - you're stopping the polling. It's a bug. In iOS all connection terminate when a browser goes to background, so auth flow is stuck when returning back. It easy reproduces in Safari browser
Thank you for consideration!