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.

Acquire Token occasionally returns "No User provided and multiple MRRTs exist for the given client id"

See original GitHub issue
  • Expected behavior Calls to acquireToken should either succeed or fail consistently.

  • Actual behavior Sometimes, calls to acquire token fail with “No User provided and multiple MRRTs exist for the given client id” in the onError callback, but will succeed if immediately retried.

  • Steps to reproduce the problem Create an app that calls either acquireToken(activity, resource, clientId, redirectUri, promptBehavior, mCallback) or acquireToken(resource, clientId, redirectUri, null, promptBehavior, null, mCallback). Try waiting some time and restart the app. Sometimes it will fail with the above error. But if acquire token is immediately called again, it will succeed.

  • Specifications like the version of the library, operating system etc. Version 1.15.1

  • Exception details

This is the exception sent back in the onError callback of acquire token: image

  • ADAL Log
CacheKeyValueDelegate  [2019-07-02 15:10:37 - {"thread_id":"2","correlation_id":"UNSET"}] Init: CacheKeyValueDelegate Android 28
     additional: null
    errorCode null
SharedPreferencesFileManager  [2019-07-02 15:10:37 - {"thread_id":"2","correlation_id":"UNSET"}] Init with storage helper:  SharedPreferencesFileManager Android 28
     additional: null
    errorCode null
AccountCredentialCache  [2019-07-02 15:10:37 - {"thread_id":"2","correlation_id":"UNSET"}] Init: AccountCredentialCache Android 28
     additional: null
    errorCode null
MsalOAuth2TokenCache  [2019-07-02 15:10:37 - {"thread_id":"2","correlation_id":"UNSET"}] Init: MsalOAuth2TokenCache Android 28
     additional: null
    errorCode null
ADALOAuth2TokenCache  [2019-07-02 15:10:37 - {"thread_id":"2","correlation_id":"UNSET"}] Init: ADALOAuth2TokenCache Android 28
     additional: null
    errorCode null
ADALOAuth2TokenCache  [2019-07-02 15:10:37 - {"thread_id":"2","correlation_id":"UNSET"}] Context is an Application? [true] Android 28
     additional: null
    errorCode null
ADALOAuth2TokenCache  [2019-07-02 15:10:37 - {"thread_id":"2","correlation_id":"UNSET"}] Validating secret key settings. Android 28
     additional: null
    errorCode null
ADALOAuth2TokenCache  [2019-07-02 15:10:37 - {"thread_id":"2","correlation_id":"UNSET"}] Initializing SharedPreferencesFileManager Android 28
     additional: null
    errorCode null
SharedPreferencesFileManager  [2019-07-02 15:10:37 - {"thread_id":"2","correlation_id":"UNSET"}] Init with storage helper:  SharedPreferencesFileManager Android 28
     additional: null
    errorCode null
AcquireTokenRequest:acquireToken  [2019-07-02 15:10:37 - 3031b01e-379e-4ace-b8e0-c1118e3b983b] Sending async task from thread:27385 ver:1.15.1 Android 28
     additional: null
    errorCode null
AcquireTokenRequest:acquireToken  [2019-07-02 15:10:37 - 3031b01e-379e-4ace-b8e0-c1118e3b983b] Running task in thread:27466 ver:1.15.1 Android 28
     additional: null
    errorCode null
AcquireTokenRequest:validateAuthority  [2019-07-02 15:10:37 - 3031b01e-379e-4ace-b8e0-c1118e3b983b] Start validating authority ver:1.15.1 Android 28
     additional: null
    errorCode null
Discovery  [2019-07-02 15:10:37 - 3031b01e-379e-4ace-b8e0-c1118e3b983b] Sending discovery request to query url.  ver:1.15.1 Android 28
     additional: null
    errorCode null
AcquireTokenRequest:validateAuthority  [2019-07-02 15:10:38 - 3031b01e-379e-4ace-b8e0-c1118e3b983b] The passed in authority is valid. ver:1.15.1 Android 28
     additional: null
    errorCode null
BrokerProxy:canSwitchToBroker  [2019-07-02 15:10:38 - 3031b01e-379e-4ace-b8e0-c1118e3b983b] Broker auth is turned off or no valid broker is available on the device, cannot switch to broker. ver:1.15.1 Android 28
     additional: null
    errorCode null
AcquireTokenRequest:tryAcquireTokenSilent  [2019-07-02 15:10:38 - 3031b01e-379e-4ace-b8e0-c1118e3b983b] Try to acquire token silently, return valid AT or use RT in the cache. ver:1.15.1 Android 28
     additional: null
    errorCode null
BrokerProxy:canSwitchToBroker  [2019-07-02 15:10:38 - 3031b01e-379e-4ace-b8e0-c1118e3b983b] Broker auth is turned off or no valid broker is available on the device, cannot switch to broker. ver:1.15.1 Android 28
     additional: null
    errorCode null
AcquireTokenRequest:tryAcquireTokenSilentLocally  [2019-07-02 15:10:38 - 3031b01e-379e-4ace-b8e0-c1118e3b983b] Try to silently get token from local cache. ver:1.15.1 Android 28
     additional: null
    errorCode null
DefaultTokenCacheStore  [2019-07-02 15:10:38 - 3031b01e-379e-4ace-b8e0-c1118e3b983b] Started to initialize storage helper ver:1.15.1 Android 28
     additional: null
    errorCode null
DefaultTokenCacheStore  [2019-07-02 15:10:38 - 3031b01e-379e-4ace-b8e0-c1118e3b983b] Finished to initialize storage helper ver:1.15.1 Android 28
     additional: null
    errorCode null
2019-07-02 11:10:38.228 27385-27466/com.***** W/KeyStore: KeyStore exception
    android.os.ServiceSpecificException:  (code 7)
        at android.os.Parcel.createException(Parcel.java:1956)
        at android.os.Parcel.readException(Parcel.java:1910)
        at android.os.Parcel.readException(Parcel.java:1860)
        at android.security.IKeystoreService$Stub$Proxy.get(IKeystoreService.java:786)
        at android.security.KeyStore.get(KeyStore.java:195)
        at android.security.keystore.AndroidKeyStoreSpi.engineGetCertificateChain(AndroidKeyStoreSpi.java:118)
        at java.security.KeyStoreSpi.engineGetEntry(KeyStoreSpi.java:484)
        at java.security.KeyStore.getEntry(KeyStore.java:1560)
        at com.microsoft.identity.common.adal.internal.cache.StorageHelper.readKeyPair(StorageHelper.java:418)
        at com.microsoft.identity.common.adal.internal.cache.StorageHelper.getKey(StorageHelper.java:363)
        at com.microsoft.identity.common.adal.internal.cache.StorageHelper.decrypt(StorageHelper.java:250)
        at com.microsoft.aad.adal.DefaultTokenCacheStore.decrypt(DefaultTokenCacheStore.java:145)
        at com.microsoft.aad.adal.DefaultTokenCacheStore.getItem(DefaultTokenCacheStore.java:163)
        at com.microsoft.aad.adal.TokenCacheAccessor.getRegularRefreshTokenCacheItem(TokenCacheAccessor.java:175)
        at com.microsoft.aad.adal.TokenCacheAccessor.getATFromCache(TokenCacheAccessor.java:138)
        at com.microsoft.aad.adal.AcquireTokenSilentHandler.getAccessToken(AcquireTokenSilentHandler.java:108)
        at com.microsoft.aad.adal.AcquireTokenRequest.tryAcquireTokenSilentLocally(AcquireTokenRequest.java:459)
        at com.microsoft.aad.adal.AcquireTokenRequest.acquireTokenSilentFlow(AcquireTokenRequest.java:435)
        at com.microsoft.aad.adal.AcquireTokenRequest.tryAcquireTokenSilent(AcquireTokenRequest.java:367)
        at com.microsoft.aad.adal.AcquireTokenRequest.performAcquireTokenRequest(AcquireTokenRequest.java:346)
        at com.microsoft.aad.adal.AcquireTokenRequest.access$200(AcquireTokenRequest.java:53)
        at com.microsoft.aad.adal.AcquireTokenRequest$1.run(AcquireTokenRequest.java:123)
        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:764)
TokenCacheItem  [2019-07-02 15:10:38 - 3031b01e-379e-4ace-b8e0-c1118e3b983b] Check token expiration time. ver:1.15.1 Android 28
     additional: null
    errorCode null
AcquireTokenSilentHandler:getAccessToken  [2019-07-02 15:10:38 - 3031b01e-379e-4ace-b8e0-c1118e3b983b] Return AT from cache. ver:1.15.1 Android 28
     additional: null
    errorCode null
AcquireTokenRequest:tryAcquireTokenSilent  [2019-07-02 15:10:38 - 3031b01e-379e-4ace-b8e0-c1118e3b983b] Token is successfully returned from silent flow.  ver:1.15.1 Android 28
     additional: null
    errorCode null
CacheKeyValueDelegate  [2019-07-02 15:11:05 - {"thread_id":"2","correlation_id":"UNSET"}] Init: CacheKeyValueDelegate Android 28
     additional: null
    errorCode null
SharedPreferencesFileManager  [2019-07-02 15:11:05 - {"thread_id":"2","correlation_id":"UNSET"}] Init with storage helper:  SharedPreferencesFileManager Android 28
     additional: null
    errorCode null
AccountCredentialCache  [2019-07-02 15:11:05 - {"thread_id":"2","correlation_id":"UNSET"}] Init: AccountCredentialCache Android 28
     additional: null
    errorCode null
MsalOAuth2TokenCache  [2019-07-02 15:11:05 - {"thread_id":"2","correlation_id":"UNSET"}] Init: MsalOAuth2TokenCache Android 28
     additional: null
    errorCode null
ADALOAuth2TokenCache  [2019-07-02 15:11:05 - {"thread_id":"2","correlation_id":"UNSET"}] Init: ADALOAuth2TokenCache Android 28
     additional: null
    errorCode null
ADALOAuth2TokenCache  [2019-07-02 15:11:05 - {"thread_id":"2","correlation_id":"UNSET"}] Context is an Application? [true] Android 28
     additional: null
    errorCode null
ADALOAuth2TokenCache  [2019-07-02 15:11:05 - {"thread_id":"2","correlation_id":"UNSET"}] Validating secret key settings. Android 28
     additional: null
    errorCode null
ADALOAuth2TokenCache  [2019-07-02 15:11:05 - {"thread_id":"2","correlation_id":"UNSET"}] Initializing SharedPreferencesFileManager Android 28
     additional: null
    errorCode null
SharedPreferencesFileManager  [2019-07-02 15:11:05 - {"thread_id":"2","correlation_id":"UNSET"}] Init with storage helper:  SharedPreferencesFileManager Android 28
     additional: null
    errorCode null
AcquireTokenRequest:acquireToken  [2019-07-02 15:11:05 - 491832f2-366c-465d-93b0-28a69df4f9e4] Sending async task from thread:27554 ver:1.15.1 Android 28
     additional: null
    errorCode null
AcquireTokenRequest:acquireToken  [2019-07-02 15:11:05 - 491832f2-366c-465d-93b0-28a69df4f9e4] Running task in thread:27636 ver:1.15.1 Android 28
     additional: null
    errorCode null
AcquireTokenRequest:validateAuthority  [2019-07-02 15:11:05 - 491832f2-366c-465d-93b0-28a69df4f9e4] Start validating authority ver:1.15.1 Android 28
     additional: null
    errorCode null
Discovery  [2019-07-02 15:11:05 - 491832f2-366c-465d-93b0-28a69df4f9e4] Sending discovery request to query url.  ver:1.15.1 Android 28
     additional: null
    errorCode null
AcquireTokenRequest:validateAuthority  [2019-07-02 15:11:06 - 491832f2-366c-465d-93b0-28a69df4f9e4] The passed in authority is valid. ver:1.15.1 Android 28
     additional: null
    errorCode null
BrokerProxy:canSwitchToBroker  [2019-07-02 15:11:06 - 491832f2-366c-465d-93b0-28a69df4f9e4] Broker auth is turned off or no valid broker is available on the device, cannot switch to broker. ver:1.15.1 Android 28
     additional: null
    errorCode null
AcquireTokenRequest:tryAcquireTokenSilent  [2019-07-02 15:11:06 - 491832f2-366c-465d-93b0-28a69df4f9e4] Try to acquire token silently, return valid AT or use RT in the cache. ver:1.15.1 Android 28
     additional: null
    errorCode null
BrokerProxy:canSwitchToBroker  [2019-07-02 15:11:06 - 491832f2-366c-465d-93b0-28a69df4f9e4] Broker auth is turned off or no valid broker is available on the device, cannot switch to broker. ver:1.15.1 Android 28
     additional: null
    errorCode null
AcquireTokenRequest:tryAcquireTokenSilentLocally  [2019-07-02 15:11:06 - 491832f2-366c-465d-93b0-28a69df4f9e4] Try to silently get token from local cache. ver:1.15.1 Android 28
     additional: null
    errorCode null
DefaultTokenCacheStore  [2019-07-02 15:11:06 - 491832f2-366c-465d-93b0-28a69df4f9e4] Started to initialize storage helper ver:1.15.1 Android 28
     additional: null
    errorCode null
DefaultTokenCacheStore  [2019-07-02 15:11:06 - 491832f2-366c-465d-93b0-28a69df4f9e4] Finished to initialize storage helper ver:1.15.1 Android 28
     additional: null
    errorCode null
2019-07-02 11:11:06.478 27554-27636/com.***** W/KeyStore: KeyStore exception
    android.os.ServiceSpecificException:  (code 7)
        at android.os.Parcel.createException(Parcel.java:1956)
        at android.os.Parcel.readException(Parcel.java:1910)
        at android.os.Parcel.readException(Parcel.java:1860)
        at android.security.IKeystoreService$Stub$Proxy.get(IKeystoreService.java:786)
        at android.security.KeyStore.get(KeyStore.java:195)
        at android.security.keystore.AndroidKeyStoreSpi.engineGetCertificateChain(AndroidKeyStoreSpi.java:118)
        at java.security.KeyStoreSpi.engineGetEntry(KeyStoreSpi.java:484)
        at java.security.KeyStore.getEntry(KeyStore.java:1560)
        at com.microsoft.identity.common.adal.internal.cache.StorageHelper.readKeyPair(StorageHelper.java:418)
        at com.microsoft.identity.common.adal.internal.cache.StorageHelper.getKey(StorageHelper.java:363)
        at com.microsoft.identity.common.adal.internal.cache.StorageHelper.decrypt(StorageHelper.java:250)
        at com.microsoft.aad.adal.DefaultTokenCacheStore.decrypt(DefaultTokenCacheStore.java:145)
        at com.microsoft.aad.adal.DefaultTokenCacheStore.getItem(DefaultTokenCacheStore.java:163)
        at com.microsoft.aad.adal.TokenCacheAccessor.getRegularRefreshTokenCacheItem(TokenCacheAccessor.java:175)
        at com.microsoft.aad.adal.TokenCacheAccessor.getATFromCache(TokenCacheAccessor.java:138)
        at com.microsoft.aad.adal.AcquireTokenSilentHandler.getAccessToken(AcquireTokenSilentHandler.java:108)
        at com.microsoft.aad.adal.AcquireTokenRequest.tryAcquireTokenSilentLocally(AcquireTokenRequest.java:459)
        at com.microsoft.aad.adal.AcquireTokenRequest.acquireTokenSilentFlow(AcquireTokenRequest.java:435)
        at com.microsoft.aad.adal.AcquireTokenRequest.tryAcquireTokenSilent(AcquireTokenRequest.java:367)
        at com.microsoft.aad.adal.AcquireTokenRequest.performAcquireTokenRequest(AcquireTokenRequest.java:346)
        at com.microsoft.aad.adal.AcquireTokenRequest.access$200(AcquireTokenRequest.java:53)
        at com.microsoft.aad.adal.AcquireTokenRequest$1.run(AcquireTokenRequest.java:123)
        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:764)
TokenCacheItem  [2019-07-02 15:11:06 - 491832f2-366c-465d-93b0-28a69df4f9e4] Check token expiration time. ver:1.15.1 Android 28
     additional: null
    errorCode null
AcquireTokenSilentHandler:getAccessToken  [2019-07-02 15:11:06 - 491832f2-366c-465d-93b0-28a69df4f9e4] Return AT from cache. ver:1.15.1 Android 28
     additional: null
    errorCode null
AcquireTokenRequest:tryAcquireTokenSilent  [2019-07-02 15:11:06 - 491832f2-366c-465d-93b0-28a69df4f9e4] Token is successfully returned from silent flow.  ver:1.15.1 Android 28
     additional: null
    errorCode null
CacheKeyValueDelegate  [2019-07-02 15:11:18 - {"thread_id":"2","correlation_id":"491832f2-366c-465d-93b0-28a69df4f9e4"}] Init: CacheKeyValueDelegate Android 28
     additional: null
    errorCode null
SharedPreferencesFileManager  [2019-07-02 15:11:18 - {"thread_id":"2","correlation_id":"491832f2-366c-465d-93b0-28a69df4f9e4"}] Init with storage helper:  SharedPreferencesFileManager Android 28
     additional: null
    errorCode null
AccountCredentialCache  [2019-07-02 15:11:18 - {"thread_id":"2","correlation_id":"491832f2-366c-465d-93b0-28a69df4f9e4"}] Init: AccountCredentialCache Android 28
     additional: null
    errorCode null
MsalOAuth2TokenCache  [2019-07-02 15:11:18 - {"thread_id":"2","correlation_id":"491832f2-366c-465d-93b0-28a69df4f9e4"}] Init: MsalOAuth2TokenCache Android 28
     additional: null
    errorCode null
ADALOAuth2TokenCache  [2019-07-02 15:11:18 - {"thread_id":"2","correlation_id":"491832f2-366c-465d-93b0-28a69df4f9e4"}] Init: ADALOAuth2TokenCache Android 28
     additional: null
    errorCode null
ADALOAuth2TokenCache  [2019-07-02 15:11:18 - {"thread_id":"2","correlation_id":"491832f2-366c-465d-93b0-28a69df4f9e4"}] Context is an Application? [true] Android 28
     additional: null
    errorCode null
ADALOAuth2TokenCache  [2019-07-02 15:11:18 - {"thread_id":"2","correlation_id":"491832f2-366c-465d-93b0-28a69df4f9e4"}] Validating secret key settings. Android 28
     additional: null
    errorCode null
ADALOAuth2TokenCache  [2019-07-02 15:11:18 - {"thread_id":"2","correlation_id":"491832f2-366c-465d-93b0-28a69df4f9e4"}] Initializing SharedPreferencesFileManager Android 28
     additional: null
    errorCode null
SharedPreferencesFileManager  [2019-07-02 15:11:18 - {"thread_id":"2","correlation_id":"491832f2-366c-465d-93b0-28a69df4f9e4"}] Init with storage helper:  SharedPreferencesFileManager Android 28
     additional: null
    errorCode null
AcquireTokenRequest:acquireToken  [2019-07-02 15:11:18 - 949eaec0-202a-49d2-93af-845ede1f413c] Sending async task from thread:27554 ver:1.15.1 Android 28
     additional: null
    errorCode null
AcquireTokenRequest:acquireToken  [2019-07-02 15:11:18 - 949eaec0-202a-49d2-93af-845ede1f413c] Running task in thread:27636 ver:1.15.1 Android 28
     additional: null
    errorCode null
BrokerProxy:canSwitchToBroker  [2019-07-02 15:11:18 - 949eaec0-202a-49d2-93af-845ede1f413c] Broker auth is turned off or no valid broker is available on the device, cannot switch to broker. ver:1.15.1 Android 28
     additional: null
    errorCode null
AcquireTokenRequest:tryAcquireTokenSilent  [2019-07-02 15:11:18 - 949eaec0-202a-49d2-93af-845ede1f413c] Try to acquire token silently, return valid AT or use RT in the cache. ver:1.15.1 Android 28
     additional: null
    errorCode null
BrokerProxy:canSwitchToBroker  [2019-07-02 15:11:18 - 949eaec0-202a-49d2-93af-845ede1f413c] Broker auth is turned off or no valid broker is available on the device, cannot switch to broker. ver:1.15.1 Android 28
     additional: null
    errorCode null
AcquireTokenRequest:tryAcquireTokenSilentLocally  [2019-07-02 15:11:18 - 949eaec0-202a-49d2-93af-845ede1f413c] Try to silently get token from local cache. ver:1.15.1 Android 28
     additional: null
    errorCode null
TokenCacheItem  [2019-07-02 15:11:21 - 949eaec0-202a-49d2-93af-845ede1f413c] Check token expiration time. ver:1.15.1 Android 28
     additional: null
    errorCode null
AcquireTokenSilentHandler:getAccessToken  [2019-07-02 15:11:21 - 949eaec0-202a-49d2-93af-845ede1f413c] Return AT from cache. ver:1.15.1 Android 28
     additional: null
    errorCode null
AcquireTokenRequest:tryAcquireTokenSilent  [2019-07-02 15:11:21 - 949eaec0-202a-49d2-93af-845ede1f413c] Token is successfully returned from silent flow.  ver:1.15.1 Android 28
     additional: null
    errorCode null
CacheKeyValueDelegate  [2019-07-02 15:11:35 - {"thread_id":"2","correlation_id":"UNSET"}] Init: CacheKeyValueDelegate Android 28
     additional: null
    errorCode null
SharedPreferencesFileManager  [2019-07-02 15:11:35 - {"thread_id":"2","correlation_id":"UNSET"}] Init with storage helper:  SharedPreferencesFileManager Android 28
     additional: null
    errorCode null
AccountCredentialCache  [2019-07-02 15:11:35 - {"thread_id":"2","correlation_id":"UNSET"}] Init: AccountCredentialCache Android 28
     additional: null
    errorCode null
MsalOAuth2TokenCache  [2019-07-02 15:11:35 - {"thread_id":"2","correlation_id":"UNSET"}] Init: MsalOAuth2TokenCache Android 28
     additional: null
    errorCode null
ADALOAuth2TokenCache  [2019-07-02 15:11:35 - {"thread_id":"2","correlation_id":"UNSET"}] Init: ADALOAuth2TokenCache Android 28
     additional: null
    errorCode null
ADALOAuth2TokenCache  [2019-07-02 15:11:35 - {"thread_id":"2","correlation_id":"UNSET"}] Context is an Application? [true] Android 28
     additional: null
    errorCode null
ADALOAuth2TokenCache  [2019-07-02 15:11:35 - {"thread_id":"2","correlation_id":"UNSET"}] Validating secret key settings. Android 28
     additional: null
    errorCode null
ADALOAuth2TokenCache  [2019-07-02 15:11:35 - {"thread_id":"2","correlation_id":"UNSET"}] Initializing SharedPreferencesFileManager Android 28
     additional: null
    errorCode null
SharedPreferencesFileManager  [2019-07-02 15:11:35 - {"thread_id":"2","correlation_id":"UNSET"}] Init with storage helper:  SharedPreferencesFileManager Android 28
     additional: null
    errorCode null
AcquireTokenRequest:acquireToken  [2019-07-02 15:11:35 - 527a9149-09dd-4e08-b1ba-27d746425f22] Sending async task from thread:27721 ver:1.15.1 Android 28
     additional: null
    errorCode null
AcquireTokenRequest:acquireToken  [2019-07-02 15:11:35 - 527a9149-09dd-4e08-b1ba-27d746425f22] Running task in thread:27819 ver:1.15.1 Android 28
     additional: null
    errorCode null
AcquireTokenRequest:validateAuthority  [2019-07-02 15:11:35 - 527a9149-09dd-4e08-b1ba-27d746425f22] Start validating authority ver:1.15.1 Android 28
     additional: null
    errorCode null
Discovery  [2019-07-02 15:11:35 - 527a9149-09dd-4e08-b1ba-27d746425f22] Sending discovery request to query url.  ver:1.15.1 Android 28
     additional: null
    errorCode null
AcquireTokenRequest:validateAuthority  [2019-07-02 15:11:36 - 527a9149-09dd-4e08-b1ba-27d746425f22] The passed in authority is valid. ver:1.15.1 Android 28
     additional: null
    errorCode null
BrokerProxy:canSwitchToBroker  [2019-07-02 15:11:36 - 527a9149-09dd-4e08-b1ba-27d746425f22] Broker auth is turned off or no valid broker is available on the device, cannot switch to broker. ver:1.15.1 Android 28
     additional: null
    errorCode null
AcquireTokenRequest:tryAcquireTokenSilent  [2019-07-02 15:11:36 - 527a9149-09dd-4e08-b1ba-27d746425f22] Try to acquire token silently, return valid AT or use RT in the cache. ver:1.15.1 Android 28
     additional: null
    errorCode null
BrokerProxy:canSwitchToBroker  [2019-07-02 15:11:36 - 527a9149-09dd-4e08-b1ba-27d746425f22] Broker auth is turned off or no valid broker is available on the device, cannot switch to broker. ver:1.15.1 Android 28
     additional: null
    errorCode null
AcquireTokenRequest:tryAcquireTokenSilentLocally  [2019-07-02 15:11:36 - 527a9149-09dd-4e08-b1ba-27d746425f22] Try to silently get token from local cache. ver:1.15.1 Android 28
     additional: null
    errorCode null
DefaultTokenCacheStore  [2019-07-02 15:11:36 - 527a9149-09dd-4e08-b1ba-27d746425f22] Started to initialize storage helper ver:1.15.1 Android 28
     additional: null
    errorCode null
DefaultTokenCacheStore  [2019-07-02 15:11:36 - 527a9149-09dd-4e08-b1ba-27d746425f22] Finished to initialize storage helper ver:1.15.1 Android 28
     additional: null
    errorCode null
2019-07-02 11:11:36.309 27721-27819/com.*****W/KeyStore: KeyStore exception
    android.os.ServiceSpecificException:  (code 7)
        at android.os.Parcel.createException(Parcel.java:1956)
        at android.os.Parcel.readException(Parcel.java:1910)
        at android.os.Parcel.readException(Parcel.java:1860)
        at android.security.IKeystoreService$Stub$Proxy.get(IKeystoreService.java:786)
        at android.security.KeyStore.get(KeyStore.java:195)
        at android.security.keystore.AndroidKeyStoreSpi.engineGetCertificateChain(AndroidKeyStoreSpi.java:118)
        at java.security.KeyStoreSpi.engineGetEntry(KeyStoreSpi.java:484)
        at java.security.KeyStore.getEntry(KeyStore.java:1560)
        at com.microsoft.identity.common.adal.internal.cache.StorageHelper.readKeyPair(StorageHelper.java:418)
        at com.microsoft.identity.common.adal.internal.cache.StorageHelper.getKey(StorageHelper.java:363)
        at com.microsoft.identity.common.adal.internal.cache.StorageHelper.decrypt(StorageHelper.java:250)
        at com.microsoft.aad.adal.DefaultTokenCacheStore.decrypt(DefaultTokenCacheStore.java:145)
        at com.microsoft.aad.adal.DefaultTokenCacheStore.getItem(DefaultTokenCacheStore.java:163)
        at com.microsoft.aad.adal.TokenCacheAccessor.getRegularRefreshTokenCacheItem(TokenCacheAccessor.java:175)
        at com.microsoft.aad.adal.TokenCacheAccessor.getATFromCache(TokenCacheAccessor.java:138)
        at com.microsoft.aad.adal.AcquireTokenSilentHandler.getAccessToken(AcquireTokenSilentHandler.java:108)
        at com.microsoft.aad.adal.AcquireTokenRequest.tryAcquireTokenSilentLocally(AcquireTokenRequest.java:459)
        at com.microsoft.aad.adal.AcquireTokenRequest.acquireTokenSilentFlow(AcquireTokenRequest.java:435)
        at com.microsoft.aad.adal.AcquireTokenRequest.tryAcquireTokenSilent(AcquireTokenRequest.java:367)
        at com.microsoft.aad.adal.AcquireTokenRequest.performAcquireTokenRequest(AcquireTokenRequest.java:346)
        at com.microsoft.aad.adal.AcquireTokenRequest.access$200(AcquireTokenRequest.java:53)
        at com.microsoft.aad.adal.AcquireTokenRequest$1.run(AcquireTokenRequest.java:123)
        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:764)
TokenCacheItem  [2019-07-02 15:11:36 - 527a9149-09dd-4e08-b1ba-27d746425f22] Check token expiration time. ver:1.15.1 Android 28
     additional: null
    errorCode null
AcquireTokenSilentHandler:getAccessToken  [2019-07-02 15:11:36 - 527a9149-09dd-4e08-b1ba-27d746425f22] Return AT from cache. ver:1.15.1 Android 28
     additional: null
    errorCode null
AcquireTokenRequest:tryAcquireTokenSilent  [2019-07-02 15:11:36 - 527a9149-09dd-4e08-b1ba-27d746425f22] Token is successfully returned from silent flow.  ver:1.15.1 Android 28
     additional: null
    errorCode null
CacheKeyValueDelegate  [2019-07-02 15:11:42 - {"thread_id":"2","correlation_id":"527a9149-09dd-4e08-b1ba-27d746425f22"}] Init: CacheKeyValueDelegate Android 28
     additional: null
    errorCode null
SharedPreferencesFileManager  [2019-07-02 15:11:42 - {"thread_id":"2","correlation_id":"527a9149-09dd-4e08-b1ba-27d746425f22"}] Init with storage helper:  SharedPreferencesFileManager Android 28
     additional: null
    errorCode null
AccountCredentialCache  [2019-07-02 15:11:42 - {"thread_id":"2","correlation_id":"527a9149-09dd-4e08-b1ba-27d746425f22"}] Init: AccountCredentialCache Android 28
     additional: null
    errorCode null
MsalOAuth2TokenCache  [2019-07-02 15:11:42 - {"thread_id":"2","correlation_id":"527a9149-09dd-4e08-b1ba-27d746425f22"}] Init: MsalOAuth2TokenCache Android 28
     additional: null
    errorCode null
ADALOAuth2TokenCache  [2019-07-02 15:11:42 - {"thread_id":"2","correlation_id":"527a9149-09dd-4e08-b1ba-27d746425f22"}] Init: ADALOAuth2TokenCache Android 28
     additional: null
    errorCode null
ADALOAuth2TokenCache  [2019-07-02 15:11:42 - {"thread_id":"2","correlation_id":"527a9149-09dd-4e08-b1ba-27d746425f22"}] Context is an Application? [true] Android 28
     additional: null
    errorCode null
ADALOAuth2TokenCache  [2019-07-02 15:11:42 - {"thread_id":"2","correlation_id":"527a9149-09dd-4e08-b1ba-27d746425f22"}] Validating secret key settings. Android 28
     additional: null
    errorCode null
ADALOAuth2TokenCache  [2019-07-02 15:11:42 - {"thread_id":"2","correlation_id":"527a9149-09dd-4e08-b1ba-27d746425f22"}] Initializing SharedPreferencesFileManager Android 28
     additional: null
    errorCode null
SharedPreferencesFileManager  [2019-07-02 15:11:42 - {"thread_id":"2","correlation_id":"527a9149-09dd-4e08-b1ba-27d746425f22"}] Init with storage helper:  SharedPreferencesFileManager Android 28
     additional: null
    errorCode null
AcquireTokenRequest:acquireToken  [2019-07-02 15:11:42 - c26dd288-0823-4f0c-8142-49dbab527be0] Sending async task from thread:27721 ver:1.15.1 Android 28
     additional: null
    errorCode null
AcquireTokenRequest:acquireToken  [2019-07-02 15:11:42 - c26dd288-0823-4f0c-8142-49dbab527be0] Running task in thread:27819 ver:1.15.1 Android 28
     additional: null
    errorCode null
BrokerProxy:canSwitchToBroker  [2019-07-02 15:11:42 - c26dd288-0823-4f0c-8142-49dbab527be0] Broker auth is turned off or no valid broker is available on the device, cannot switch to broker. ver:1.15.1 Android 28
     additional: null
    errorCode null
AcquireTokenRequest:tryAcquireTokenSilent  [2019-07-02 15:11:42 - c26dd288-0823-4f0c-8142-49dbab527be0] Try to acquire token silently, return valid AT or use RT in the cache. ver:1.15.1 Android 28
     additional: null
    errorCode null
BrokerProxy:canSwitchToBroker  [2019-07-02 15:11:42 - c26dd288-0823-4f0c-8142-49dbab527be0] Broker auth is turned off or no valid broker is available on the device, cannot switch to broker. ver:1.15.1 Android 28
     additional: null
    errorCode null
AcquireTokenRequest:tryAcquireTokenSilentLocally  [2019-07-02 15:11:42 - c26dd288-0823-4f0c-8142-49dbab527be0] Try to silently get token from local cache. ver:1.15.1 Android 28
     additional: null
    errorCode null
TokenCacheItem  [2019-07-02 15:11:42 - c26dd288-0823-4f0c-8142-49dbab527be0] Check token expiration time. ver:1.15.1 Android 28
     additional: null
    errorCode null
AcquireTokenSilentHandler:getAccessToken  [2019-07-02 15:11:42 - c26dd288-0823-4f0c-8142-49dbab527be0] Return AT from cache. ver:1.15.1 Android 28
     additional: null
    errorCode null
AcquireTokenRequest:tryAcquireTokenSilent  [2019-07-02 15:11:42 - c26dd288-0823-4f0c-8142-49dbab527be0] Token is successfully returned from silent flow.  ver:1.15.1 Android 28
     additional: null
    errorCode null

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
iambmeltcommented, Oct 31, 2019

@hamiltonha Let’s get feedback from @chrisetler

For the general case, this is a usage issue: the error being triggered is No User provided and multiple MRRTs exist for the given client id – this a check thrown by logic added in https://github.com/AzureAD/azure-activedirectory-library-for-android/pull/836 when ambiguous acquireTokenSilent calls are made. The solution is to provide a userid in the request.

@chrisetler Can you confirm the above unblocks/unblocked you?

For other warning issued in the logs concerning KeyStore, this change has not yet shipped but should not be a blocker. The KeyStore update mentioned in https://github.com/AzureAD/microsoft-authentication-library-common-for-android/pull/533 has merged to dev but was not deployed in our Adal@1.16.3-hf1+Common@0.0.10-hf1 release. That issue is tracked separately here and cannot yet close. Once an updated 1.16.4 or higher ships, that issue can be closed.

1reaction
iambmeltcommented, Oct 31, 2019

@jennyf19 - No specific root cause for this issue has been identified. I suspect it is due to misbehavior on select devices pertaining to KeyStore.

We recently accepted a fix to update the APIs we’re using around KeyStore in https://github.com/AzureAD/microsoft-authentication-library-common-for-android/pull/533 – these changes have merged but have not yet been deployed. I don’t know yet for certain what version number will be chosen but expect them to arrive in our next release: 1.16.4 or later

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why does Azure AD issue access tokens with client ...
I am able to get access tokens from Azure AD with client credentials grant irrespective of the scope (resource), is this expected?
Read more >
Create a Flask Application With Google Login - Real Python
In this step-by-step tutorial, you'll create a Flask application that lets users sign in using their Google login. You'll learn about OAuth 2...
Read more >
Salesforce Multi-Factor Authentication FAQ
MFA and 2FA both protect against unauthorized access by requiring a user to provide multiple authentication factors to prove their identity.
Read more >
Authentication and authorization OpenShift Container Platform ...
Users obtain OAuth access tokens to authenticate themselves to the API. When a person requests a new OAuth token, the OAuth server uses...
Read more >
The Client ID and Secret - OAuth 2.0 Simplified
The client_secret is a secret known only to the application and the authorization server. It is essential the application's own password. It ...
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