MsalClientException: Sdk cancelled the auth flow as the app launched a new interactive auth request
See original GitHub issueDescribe the bug When using application.requireAuthToken or application.login the callback gets cancelled when the browser opens AND ‘Don’t keep activities’ is enabled in the device developer settings
Smartphone (please complete the following information):
- Device: Any
- Android Version: Any
- Browser [e.g. Chrome, Edge] Any
- MSAL Version: 1.2.0
Stacktrace
com.microsoft.identity.client.exception.MsalClientException: Sdk cancelled the auth flow as the app launched a new interactive auth request.
at com.microsoft.identity.client.internal.controllers.MsalExceptionAdapter.msalExceptionFromBaseException(MsalExceptionAdapter.java:51)
at com.microsoft.identity.client.PublicClientApplication$9.onError(PublicClientApplication.java:1631)
at com.microsoft.identity.client.PublicClientApplication$9.onError(PublicClientApplication.java:1621)
at com.microsoft.identity.common.internal.controllers.CommandDispatcher$3$4.run(CommandDispatcher.java:341)
at android.os.Handler.handleCallback(Handler.java:883)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7356)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
Caused by: com.microsoft.identity.common.exception.ClientException: Sdk cancelled the auth flow as the app launched a new interactive auth request.
at com.microsoft.identity.common.internal.controllers.ExceptionAdapter.exceptionFromAcquireTokenResult(ExceptionAdapter.java:93)
at com.microsoft.identity.common.internal.controllers.CommandDispatcher$3.run(CommandDispatcher.java:327)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:919)
To Reproduce Steps to reproduce the behavior:
- Turn on ‘Don’t keep activities’ in the developer settings on your device
- Try to sign in (reproducible in the app found at the quickstart)
- Browser opens, you do your auth thing, hit continue
- Browser closes, nothing happens
Expected behavior Authorization should work
Actual Behavior Authorization does not work
Issue Analytics
- State:
- Created 4 years ago
- Comments:13 (8 by maintainers)
Top Results From Across the Web
Handle errors and exceptions in MSAL.NET - Microsoft Entra
Launching interactive authentication flow will show a message explaining the condition. Call AcquireTokenInteractively() to show a message that ...
Read more >Is there a way to connect Azure B2C using MSAL library in ...
When I use this method I get "com.microsoft.identity.client.exception.MsalClientException: Sdk cancelled the auth flow as the app launched a new ...
Read more >Microsoft Authentication Library for JavaScript (MSAL.js)
The MSAL library for JavaScript enables client-side JavaScript web applications, running in a web browser, to authenticate users using Azure AD work and ......
Read more >Microsoft.Identity.Client.xml 4.8.1 - PowerShell Gallery
Constructor meant to help application developers test their apps. Allows mocking of authentication flows. App developers should <b>never</b> new-up <see ...
Read more >Authentication Failed: Com.Microsoft.Identity.Client.Exception ...
Likely caused when constructing the auth request authority or redirect URI. ... Exceptions in Microsoft Authentication Library MSAL are intended for app For ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
https://docs.microsoft.com/en-us/azure/active-directory/develop/msal-configuration - See authorization_user_agent setting
Closing as resolved