question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

MsalClientException: Sdk cancelled the auth flow as the app launched a new interactive auth request

See original GitHub issue

Describe 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:

  1. Turn on ‘Don’t keep activities’ in the developer settings on your device
  2. Try to sign in (reproducible in the app found at the quickstart)
  3. Browser opens, you do your auth thing, hit continue
  4. Browser closes, nothing happens

Expected behavior Authorization should work

Actual Behavior Authorization does not work

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:13 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
shoatmancommented, Feb 7, 2020
0reactions
iambmeltcommented, Dec 2, 2020

Closing as resolved

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found