[Bug] AcquireTokenSilent not working after few mintunes in ios and anroid giving error
See original GitHub issueWhich Version of MSAL are you using ?
MSAL 4.14.0
Platform Xamarin forms (Android and IOS)
What authentication flow has the issue?
- Mobile
- [ this] Interactive
- Integrated Windows Auth
- Username Password
- Device code flow (browserless)
Other? - please describe;
Is this a new or existing app? c. This is a new app or experiment
Repro
Initially, application opening a login page, after entering the credentials, I am able to receive the token. Once application closed and suddenly open its getting token sliently by using below method:
authResult = await App.PCA.AcquireTokenSilent(App.Scopes, firstAccount).ExecuteAsync();
But after 15-20 min , when trying to open the application its again prompting for login screen.
Please help.
Android : - Android behaving weird,AcquireTokenSilent sometimes getting proper result, but sometime getting "Broker response returned error: Failed to acquire token sliently from the broker. IN order to perform brokered authentication on android you need to ensure that you have installed either Intune company portal(5.0.4789.0 or greater) or Microsoft Authenticator (6.2001.01400 or greater).
But I have already installed both above application.
PLEASE HELP
**Expected behavior**
IOS - Should not prompt for login screen after any mintues as already entered credentials once.
Android - Should not give any error as company portal and microsoft authenticator app already installed in the device.
**Actual behavior**
IOS - After few mins its asking for login with credentials
ANdorid - Anytime giving this error "Broker response returned error: Failed to acquire token sliently from the broker. IN order to perform brokered authentication on android you need to ensure that you have installed either Intune company portal(5.0.4789.0 or greater) or Microsoft Authenticator (6.2001.01400 or greater).
**Possible Solution**
NO solution. Please help me
**Additional context/ Logs / Screenshots**
Issue Analytics
- State:
- Created 3 years ago
- Comments:13 (6 by maintainers)
Top Results From Across the Web
Not getting token with acquireTokensilent but ...
The thing is when i am using acquireTokenSilent its giving error as: getTokenerror BrowserAuthError: no_account_error: No account object ...
Read more >MsalError Class (Microsoft.Identity.Client)
Error code returned as a property in MsalException. ... the device code expired before the user signed-in on another device (this is usually...
Read more >Msal acquiretokensilent example. Have you run into this or ...
The following code snippet illustrates token acquisition in an MSAL Node confidential ... but they are still receiving critical security bug fix support....
Read more >O365 refresh token. Copy the 'Application (client) ID and paste it
This is easy to fix by running the rclone config reconnect remote: command to get a new token and refresh token. Microsoft recently...
Read more >Clear aad broker cache. It is important to note that forcing ...
We are working to add a fix to clear the cache. Right click on Windows PowerShell on the results and select Run as...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks @bgavrilMS You helped a lot… and issue is resolved now. Thanks
If the callback signature is
public string acquireToken(String upn, String aadId, String resourceId)
then I would implement it asSomething like that. Not sure what the
aadId
is though, is it the client id? Or a tenant ID?