AzureAD/azure-activedirectory-library-for-android

Authority Validation Triggers NPE in PPE

Closed this issue · 2 comments

If true == validateAuthority in the PPE environment, ADAL emits the following NPE due to a missing authority record in the discovery document.

    java.lang.NullPointerException: Attempt to invoke virtual method 'boolean com.microsoft.identity.common.internal.providers.microsoft.azureactivedirectory.AzureActiveDirectoryCloud.isValidated()' on a null object reference
        at com.microsoft.identity.common.internal.providers.microsoft.azureactivedirectory.AzureActiveDirectoryOAuth2Strategy.getIssuerCacheIdentifier(AzureActiveDirectoryOAuth2Strategy.java:109)
        at com.microsoft.identity.common.internal.cache.ADALOAuth2TokenCache.save(ADALOAuth2TokenCache.java:129)
        at com.microsoft.aad.adal.TokenCacheAccessor.updateTokenCacheUsingCommonCache(TokenCacheAccessor.java:359)
        at com.microsoft.aad.adal.TokenCacheAccessor.updateTokenCache(TokenCacheAccessor.java:315)
        at com.microsoft.aad.adal.AcquireTokenInteractiveRequest.acquireTokenWithAuthCode(AcquireTokenInteractiveRequest.java:126)
        at com.microsoft.aad.adal.AcquireTokenRequest$3.run(AcquireTokenRequest.java:885)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
        at java.lang.Thread.run(Thread.java:764)

/cc @vicalcazar

Related: AzureAD/microsoft-authentication-library-common-for-android#220

Current guidance is to set false == validateAuthority when PPE is used

Closing as no-op as library is crit-fixes only