azure-activedirectory-library-for-android icon indicating copy to clipboard operation
azure-activedirectory-library-for-android copied to clipboard

No result returned from acquireTokenSilent

Open doocao826 opened this issue 5 years ago • 3 comments

outlook/o365 user will be prompted to reauth repeatedly using outlook mobile. even after installing Authenticator.

  • Expected behavior once the user input credential, reauth should not be required.

  • Actual behavior users are repeatedly asked to reauth

  • Relevant logs and traces I 2019-03-12T06:23:55.567+0000 [ci=fvlCHvsVPG] AndroidJob-35 outlook.Accounts ADALOAuth2TokenCache: [2019-03-12 06:23:55 - {"thread_id":"1782","correlation_id":"da2c0471-1759-422d-af3d-b1318d521927"}] Context is an Application? [true] Android 26 (null) - null I 2019-03-12T06:23:55.596+0000 [ci=fvlCHvsVPG] pool-19-thread-1 outlook.Accounts AcquireTokenRequest:tryAcquireTokenSilentWithBroker: [2019-03-12 06:23:55 - da2c0471-1759-422d-af3d-b1318d521927] Either could not get tokens from local cache or is force refresh request, switch to Broker for auth, clear tokens from local cache for the user. ver:1.16.1 Android 26 (null) - null I 2019-03-12T06:23:55.603+0000 [ci=fvlCHvsVPG] pool-19-thread-1 outlook.Accounts AcquireTokenWithBrokerRequest:logBrokerVersion: [2019-03-12 06:23:55 - da2c0471-1759-422d-af3d-b1318d521927] Broker app is: com.azure.authenticator;Broker app version: VersionName=6.4.3;VersonCode=146. ver:1.16.1 Android 26 (null) - null I 2019-03-12T06:23:55.688+0000 [ci=fvlCHvsVPG] AndroidJob-35 outlook.Accounts Marking account as needing reauth. (accountId=32768) I 2019-03-12T06:23:55.691+0000 [ci=fvlCHvsVPG] AndroidJob-35 outlook.Accounts Account 32768 (Office365RestDirect) requires interactive login. Showing notification.pl_android_loginprompt com.microsoft.office.outlook.token.TokenUpdateStrategy$TokenUpdateException: com.microsoft.aad.adal.AuthenticationException: Received error from broker, errorCode: Refresh token is failed and prompt is not allowed; ErrorDescription: Request authority:https://login.microsoftonline.com/common resource:https://outlook.office365.com/ clientid:27922004-5251-4030-b22d-91ecd9a37ea4 at com.microsoft.office.outlook.token.AadTokenUpdateStrategy$AadTokenAcquirer.acquireTokenSilentSync(AadTokenUpdateStrategy.java:156) at com.microsoft.office.outlook.token.Office365TokenUpdateStrategy$Office365TokenAcquirer.acquireTokenSilentSync(Office365TokenUpdateStrategy.java:177) at com.microsoft.office.outlook.token.AbstractTokenUpdateStrategy.updateAccountTokensSilent(AbstractTokenUpdateStrategy.java:77) at com.microsoft.office.outlook.job.AccountTokenRefreshJob.runAccountTokenRefreshJobCriticalBlock(AccountTokenRefreshJob.java:310) at com.microsoft.office.outlook.job.AccountTokenRefreshJob.runAccountTokenRefreshJob(AccountTokenRefreshJob.java:233) at com.microsoft.office.outlook.job.AccountTokenRefreshJob.onJobRun(AccountTokenRefreshJob.java:197) at com.microsoft.office.outlook.profiling.job.ProfiledJob.onRunJob(ProfiledJob.java:47) at com.evernote.android.job.Job.runJob(Job.java:124) at com.evernote.android.job.JobExecutor$JobCallable.b(JobExecutor.java:181) at com.evernote.android.job.JobExecutor$JobCallable.a(JobExecutor.java:166) at com.evernote.android.job.JobExecutor$JobCallable.call(JobExecutor.java:149) at java.util.concurrent.FutureTask.run(FutureTask.java:266) 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:784) Caused by: com.microsoft.aad.adal.AuthenticationException: Received error from broker, errorCode: Refresh token is failed and prompt is not allowed; ErrorDescription: Request authority:https://login.microsoftonline.com/common resource:https://outlook.office365.com/ clientid:27922004-5251-4030-b22d-91ecd9a37ea4 at com.microsoft.aad.adal.BrokerProxy.getAuthenticationExceptionForResult(BrokerProxy.java:571) at com.microsoft.aad.adal.BrokerProxy.getResultFromBrokerResponse(BrokerProxy.java:484) at com.microsoft.aad.adal.BrokerProxy.getAuthTokenInBackground(BrokerProxy.java:335) at com.microsoft.aad.adal.AcquireTokenWithBrokerRequest.acquireTokenWithBrokerSilent(AcquireTokenWithBrokerRequest.java:69) at com.microsoft.aad.adal.AcquireTokenRequest.tryAcquireTokenSilentWithBroker(AcquireTokenRequest.java:515) at com.microsoft.aad.adal.AcquireTokenRequest.acquireTokenSilentFlow(AcquireTokenRequest.java:476) at com.microsoft.aad.adal.AcquireTokenRequest.tryAcquireTokenSilent(AcquireTokenRequest.java:373) at com.microsoft.aad.adal.AcquireTokenRequest.performAcquireTokenRequest(AcquireTokenRequest.java:352) at com.microsoft.aad.adal.AcquireTokenRequest.access$200(AcquireTokenRequest.java:55) at com.microsoft.aad.adal.AcquireTokenRequest$1.run(AcquireTokenRequest.java:129)

doocao826 avatar Mar 14 '19 03:03 doocao826

@shoatman many thanks for investigating this issue. is there any chance we can have some update?

doocao826 avatar Apr 04 '19 03:04 doocao826

Do you have any updates on this issue? I reproduced it with ADAL 3.0.2.

com.microsoft.aad.adal.AuthenticationException: Request authority:https://login.microsoftonline.com/<...> clientid:<...> No result returned from acquireTokenSilent at com.microsoft.aad.adal.AcquireTokenRequest.tryAcquireTokenSilent(AcquireTokenRequest.java:396) at com.microsoft.aad.adal.AcquireTokenRequest.performAcquireTokenRequest(AcquireTokenRequest.java:358) at com.microsoft.aad.adal.AcquireTokenRequest.access$200(AcquireTokenRequest.java:57) at com.microsoft.aad.adal.AcquireTokenRequest$1.run(AcquireTokenRequest.java:131) 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)

alinciupeiu avatar Jun 05 '20 16:06 alinciupeiu

@alinciupeiu alinciupeiu I'm also getting similar kind of issue.

I see this bug on ADAL v3.1.2, later updated the ADAL v4.0.2. But no luck. Did you get any solution or cause for this issue.

shanmugpriyan306 avatar Jun 24 '22 05:06 shanmugpriyan306