-
Notifications
You must be signed in to change notification settings - Fork 347
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] AcquireTokenSilent / GetAccounts / RemoveAccounts + Broker is not consistent with MSAL.Android behaviour #1820
Comments
CC @rpdome for confirmation |
The way we implemented this is that we have two controllers, LocalMsalController and BrokerMsalController. For silent operation, if broker is installed and is eligible***, then we'll add both controller to the list and pass it to the SilentTokenCommand. The command would try to get the token with LocalMsalController first (as it's added first in the list). Other commands that could take both controllers are
The rest of the commands (in your case, interactive acquire token) will always go straight to 'the default controller'. *** in MSAL Android, an app can opt out from using Broker via configuration file. |
Thank you for confirming Dome and explaining the architecture. A couple of follow up questions:
|
Resolved in 4.15 |
Which Version of MSAL are you using ?
4.13
Platform
Android
Expected behavior
GetAccounts should fetch local accounts from MSAL cache and the broker accounts and merge them by home_account_id.
RemoveAccount should remove the account and associted tokens from both local cache and from the broker
AcquireTokenSilent should first try to get a token from local cache and, if none is available, from the broker.
Note: the local cache should not contain an RT because the broker does not give MSAL the RT. But if it does, MSAL can still use it to get back a token. If there are any failures, MSAL will fallback to the broker. I have a concern here that we will silently ignore a bunch of exceptions which can lead to perf degradation...
Actual behavior
GetAccounts does not merge local and broker accounts.
RemoveAccoutns does not remove local accoutns and tokens
ATS does not search the local cache
Impact
By not merging local state with broker state, developer does not have an overview of what accounts exist and thefore not be able to use AcquireTokenSilent, but have to rely on AcquireTokenInteractive.
This affects especially users who use an app before and after the broker is installed or who uninstall the broker.
The text was updated successfully, but these errors were encountered: