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.

AcquireToken silently fails for authenticator app

See original GitHub issue

Please ensure the following information is provided when logging a new issue:

  • Expected behavior : MS Authenticator app should return access token
  • Actual behavior : Authenticator app throws AUTH_REFRESH_FAILED_PROMPT_NOT_ALLOWED exception
  • Step 1 : Install MS authenticator app (Broker app version: VersionName=6.2.13;VersonCode=103. ver:1.13.3 ).

    Step 2: Create valid application on azure portal and use client id with android application. This application first calls acquire token api (acquireToken(Activity activity, String resource, String clientId, @Nullable String redirectUri, @Nullable String loginHint, @Nullable PromptBehavior prompt, @Nullable String extraQueryParameters, AuthenticationCallback<AuthenticationResult> callback)) from which I can successfully get access token for resource (example O365SharePoint).

    Step 3 : Now since the user already logged so this application calls acquireTokenSilentAsync(String resource, String clientId, String userId, AuthenticationCallback<AuthenticationResult> callback) api to get token when it is running in background. This call fails with exception as AUTH_REFRESH_FAILED_PROMPT_NOT_ALLOWED.

    Note : Credentials are not expired, account is valid.

    LOGS

    _02-22 11:33:33.795 9892-10610/? I/SampleApp Docs:SampleAppSDK: pool-8-thread-5 | SampleAppAdalSDK ADAL | acquiring token token sync
    02-22 11:33:33.795 9892-10610/? V/PRNGFixes: 2018-02-22 11:33:33-cd98646c-bc59-497d-8289-76823fa77251-No need to apply the fix ver:1.13.3
    02-22 11:33:33.796 9892-10610/? V/PRNGFixes: 2018-02-22 11:33:33-cd98646c-bc59-497d-8289-76823fa77251-No need to apply the fix ver:1.13.3
    02-22 11:33:33.798 9892-10610/? V/BrokerProxy: 2018-02-22 11:33:33-cd98646c-bc59-497d-8289-76823fa77251-Device runs on 23 and above, skip the check for 22 and below. ver:1.13.3
    02-22 11:33:33.800 9892-10610/? V/AcquireTokenRequest: 2018-02-22 11:33:33-b4e2cf76-1f98-4a6e-8114-287e7e5145cc-Sending async task from thread:10610 ver:1.13.3
    02-22 11:33:33.800 9892-10586/? V/AcquireTokenRequest: 2018-02-22 11:33:33-b4e2cf76-1f98-4a6e-8114-287e7e5145cc-Running task in thread:10586 ver:1.13.3
    02-22 11:33:33.803 9892-10586/? V/AcquireTokenRequest: 2018-02-22 11:33:33-b4e2cf76-1f98-4a6e-8114-287e7e5145cc-Try to acquire token silently, return valid AT or use RT in the cache. ver:1.13.3
    02-22 11:33:33.803 9892-10586/? V/AcquireTokenRequest: 2018-02-22 11:33:33-b4e2cf76-1f98-4a6e-8114-287e7e5145cc-Try to silently get token from local cache. ver:1.13.3
    02-22 11:33:33.804 9892-10586/? V/TokenCacheAccessor: 2018-02-22 11:33:33-b4e2cf76-1f98-4a6e-8114-287e7e5145cc-No access token exists. ver:1.13.3
    02-22 11:33:33.805 9892-10586/? V/AcquireTokenSilentHandler: 2018-02-22 11:33:33-b4e2cf76-1f98-4a6e-8114-287e7e5145cc-No valid access token exists, try with refresh token. ver:1.13.3
    02-22 11:33:33.807 9892-10586/? V/AcquireTokenSilentHandler: 2018-02-22 11:33:33-b4e2cf76-1f98-4a6e-8114-287e7e5145cc-Regular token cache entry does not exist, try with MRRT. ver:1.13.3
    02-22 11:33:33.809 9892-10586/? V/AcquireTokenSilentHandler: 2018-02-22 11:33:33-b4e2cf76-1f98-4a6e-8114-287e7e5145cc-MRRT token does not exist, try with FRT ver:1.13.3
    02-22 11:33:33.810 9892-10586/? V/AcquireTokenSilentHandler: 2018-02-22 11:33:33-b4e2cf76-1f98-4a6e-8114-287e7e5145cc-FRT cache item does not exist, fall back to try MRRT. ver:1.13.3
    02-22 11:33:33.811 9892-10586/? V/AcquireTokenSilentHandler: 2018-02-22 11:33:33-b4e2cf76-1f98-4a6e-8114-287e7e5145cc-Send request to use MRRT for new AT. ver:1.13.3
    02-22 11:33:33.811 9892-10586/? V/AcquireTokenSilentHandler: 2018-02-22 11:33:33-b4e2cf76-1f98-4a6e-8114-287e7e5145cc-MRRT does not exist, cannot proceed with MRRT for new AT. ver:1.13.3
    02-22 11:33:33.815 9892-10586/? D/AcquireTokenRequest: Cannot get AT from local cache, switch to Broker for auth, clear tokens from local cache for the user.
    02-22 11:33:33.817 9892-10586/? V/AcquireTokenRequest: 2018-02-22 11:33:33-b4e2cf76-1f98-4a6e-8114-287e7e5145cc-No token items need to be deleted for the user. ver:1.13.3
    02-22 11:33:33.818 9892-10586/? I/AcquireTokenWithBrokerRequest: 2018-02-22 11:33:33-b4e2cf76-1f98-4a6e-8114-287e7e5145cc-Broker app is: com.azure.authenticator;Broker app version: VersionName=6.2.13;VersonCode=103. ver:1.13.3 
    02-22 11:33:33.819 9892-10586/? V/AcquireTokenWithBrokerRequest: 2018-02-22 11:33:33-b4e2cf76-1f98-4a6e-8114-287e7e5145cc-User is specified for background(silent) token request, trying to acquire token silently. ver:1.13.3
    02-22 11:33:33.820 9892-10586/? V/BrokerAccountServiceHandler: 2018-02-22 11:33:33-b4e2cf76-1f98-4a6e-8114-287e7e5145cc-Binding to BrokerAccountService for caller uid: 10091 ver:1.13.3
    02-22 11:33:33.826 9892-10586/? V/BrokerAccountServiceHandler: 2018-02-22 11:33:33-b4e2cf76-1f98-4a6e-8114-287e7e5145cc-The status for brokerAccountService bindService call is: true ver:1.13.3
    02-22 11:33:33.840 9892-9892/? V/BrokerAccountServiceHandler: 2018-02-22 11:33:33-b4e2cf76-1f98-4a6e-8114-287e7e5145cc-Broker Account service is connected. ver:1.13.3
    02-22 11:33:33.852 9892-10585/? I/SampleApp Docs:SampleAppSDK: AcquireTokenRequestHandlerThread | SampleAppAdalSDK ADAL | acquired token silently failed com.microsoft.aad.adal.AuthenticationException: Received error from broker, errorCode: AUTH_REFRESH_FAILED_PROMPT_NOT_ALLOWED; ErrorDescription: Account does not exist in the broker, cannot proceed with silent request
    02-22 11:33:33.852 9892-10585/? I/SampleApp Docs:SampleAppSDK: AcquireTokenRequestHandlerThread | SampleAppAdalSDK ADAL | acquired token sync failed_
    

    Please note: Do not include sensitive information like PII, OII, credentials, secrets, and tokens.

    For privacy/security issues please see instructions here

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
akshaydugarcommented, Oct 8, 2018

@addev-ashish @iambmelt Is this issue not going to be looked at? There has been no update on this ticket since it was reopened 2 months ago.

0reactions
iambmeltcommented, Aug 6, 2021

Closing as no-op as library is crit-fixes only. Please file a new issue for our latest release if this issue continues to persist 1.x versions are out of support

Read more comments on GitHub >

github_iconTop Results From Across the Web

AcquireTokenSilent always returns "Failed to acquire token ...
When I call the method it throws and exception with the error message of "Failed to acquire token silently. Call method AcquireToken".
Read more >
AcquireTokenSilent always Failed to acquire token silently
The issue was that basically I was using Common Authority https://login.windows.net/common/oauth2/authorize in my App. It works for ...
Read more >
MSAL on CocoaPods.org
The MSAL library for iOS and macOS gives your app the ability to begin using ... Once the MSAL account is retrieved, invoke...
Read more >
AuthenticationContext (adal 1.16.3 API) - javadoc.io
acquireToken will start an interactive auth flow to acquire new tokens with ... was an error communicating with the authenticator or if the...
Read more >
msal_flutter | Flutter Package - Pub.dev
Import the Msal Flutter package into your flutter application by adding it to the ... token has expired and and acquire token silently...
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