(Not sure if there is a bug in MSAL, a glitch on my Android device, or a bug in my code)
On Android, Is there a manual way of clearing all accounts at the OS level? I seem to have got an Account that is "stuck" in the cache on my testing device.
I'm using the standard pattern from the samples: I call PCA.GetAccounts(), and if there is only one account, I attempt to use that with PCA.AcquireTokenSilent(). If I catch a MsalUiRequiredException, I try again with PCA.AcquireTokenInteractive(). To log the user out, I make a call to PCA.RemoveAsync() with the logged in Account.
Given two users, "[email protected]" and "[email protected]". User1 is my account, that I normally test and debug with. This all works fine with account User1. After logging out and restarting the app, User1 is not returned from the call PCA.GetAccounts().
Here's the problem: At some point, I used another account (User2) to log on, as I wanted to test it with more than one account. Now User2 is always returned in the call from PCA.GetAccounts(). If I call PCA.GetAccounts() before restarting the app, User2 is gone. But when I restart the app, it's back. Doing the same method with User1 works perfectly: if I log out User1, it is gone until I acquire a token for it again. It also works perfectly on UWP. I have not tested iOS.
This is a corporate app and all my users have orders not to share passwords or phones, so it's not a huge problem yet. But I'd really like to know what to do if this happens to one of their devices, and it would be nice to clear my testing device. This problem causes the app to log on with the wrong Account when all other accounts have been logged out.
What I've tried:
AndroidTokenCacheAccessor: AccessTokenSharedPreferenceName, RefreshTokenSharedPreferenceName, IdTokenSharedPreferenceName, and AccountSharedPreferenceName. These Shared Preferences disappear, then when I restart the app, they are back.Particulars:
If you need any more info, I'm happy to provide it.
@ericcox Thanks for all the details, very helpful. One of us will try to repro this. Could you provide logs as well? You can email them if you prefer.
Can you also share how your code is set up, for creating the PCA and the acquire token calls? Thanks.
@jennyf19 Thanks for the response.
I completely forgot I had debug logging on. There is voluminous amounts of Android logging going on so I don't have MSAL logs by themselves at the moment, but here are all the lines with "MSAL" in them. (I can add the logging code to isolate the MSAL logs if neccessary - let me know.):
[0:] Info: (False) MSAL 3.0.4.0 MSAL.Xamarin.Android 28 [05/31/2019 16:24:30] (UnknownClient: 0.0.0.0) Deserialized 1 items to token cache.
[0:] Info: (False) MSAL 3.0.4.0 MSAL.Xamarin.Android 28 [05/31/2019 16:24:30 - eaa614d2-ee8b-4c21-9117-b5f3182cb4d0] (UnknownClient: 0.0.0.0) MSAL MSAL.Xamarin.Android with assembly version '3.0.4.0', file version '3.0.4.0' and informational version '3.0.4-localbuild+6e60685c88ebf60ce805e58c2b549444870b70be'. TelemetryCorrelationId(eaa614d2-ee8b-4c21-9117-b5f3182cb4d0)
[0:] Info: (False) MSAL 3.0.4.0 MSAL.Xamarin.Android 28 [05/31/2019 16:24:30 - eaa614d2-ee8b-4c21-9117-b5f3182cb4d0] (UnknownClient: 0.0.0.0) === OnBehalfOfParameters ===
[0:] Info: (False) MSAL 3.0.4.0 MSAL.Xamarin.Android 28 [05/31/2019 16:24:30 - eaa614d2-ee8b-4c21-9117-b5f3182cb4d0] (UnknownClient: 0.0.0.0)
[0:] Info: (False) MSAL 3.0.4.0 MSAL.Xamarin.Android 28 [05/31/2019 16:24:30 - eaa614d2-ee8b-4c21-9117-b5f3182cb4d0] (UnknownClient: 0.0.0.0) === Token Acquisition (SilentRequest) started:
[0:] Info: (False) MSAL 3.0.4.0 MSAL.Xamarin.Android 28 [05/31/2019 16:24:31 - eaa614d2-ee8b-4c21-9117-b5f3182cb4d0] (UnknownClient: 0.0.0.0) Looking up access token in the cache.
[0:] Info: (False) MSAL 3.0.4.0 MSAL.Xamarin.Android 28 [05/31/2019 16:24:31 - eaa614d2-ee8b-4c21-9117-b5f3182cb4d0] (UnknownClient: 0.0.0.0) Filtering by home account id item count before 1 after 1
[0:] Info: (False) MSAL 3.0.4.0 MSAL.Xamarin.Android 28 [05/31/2019 16:24:31 - eaa614d2-ee8b-4c21-9117-b5f3182cb4d0] (UnknownClient: 0.0.0.0) Tenant id: [company].com
[0:] Info: (False) MSAL 3.0.4.0 MSAL.Xamarin.Android 28 [05/31/2019 16:24:31 - eaa614d2-ee8b-4c21-9117-b5f3182cb4d0] (UnknownClient: 0.0.0.0) Filtering by tenant id item count before 1 after 1
[0:] Info: (False) MSAL 3.0.4.0 MSAL.Xamarin.Android 28 [05/31/2019 16:24:31 - eaa614d2-ee8b-4c21-9117-b5f3182cb4d0] (UnknownClient: 0.0.0.0) Matching entry count -1
[0:] Info: (False) MSAL 3.0.4.0 MSAL.Xamarin.Android 28 [05/31/2019 16:24:31 - eaa614d2-ee8b-4c21-9117-b5f3182cb4d0] (UnknownClient: 0.0.0.0) Matching entry count after filtering by scopes - 1
[0:] Info: (False) MSAL 3.0.4.0 MSAL.Xamarin.Android 28 [05/31/2019 16:24:31 - eaa614d2-ee8b-4c21-9117-b5f3182cb4d0] (UnknownClient: 0.0.0.0) Access token has expired or about to expire. [Current time (05/31/2019 16:24:31) - Expiration Time (05/24/2019 21:33:01 +00:00) - Extended Expiration Time (05/24/2019 21:33:01 +00:00)]
[0:] Info: (False) MSAL 3.0.4.0 MSAL.Xamarin.Android 28 [05/31/2019 16:24:31 - eaa614d2-ee8b-4c21-9117-b5f3182cb4d0] (UnknownClient: 0.0.0.0) Looking up refresh token in the cache..
[0:] Info: (False) MSAL 3.0.4.0 MSAL.Xamarin.Android 28 [05/31/2019 16:24:31 - eaa614d2-ee8b-4c21-9117-b5f3182cb4d0] (UnknownClient: 0.0.0.0) Refresh token found in the cache? - True
[0:] Info: (False) MSAL 3.0.4.0 MSAL.Xamarin.Android 28 [05/31/2019 16:24:31 - eaa614d2-ee8b-4c21-9117-b5f3182cb4d0] (UnknownClient: 0.0.0.0) Resolving authority endpoints... Already resolved? - FALSE
[0:] Info: (False) MSAL 3.0.4.0 MSAL.Xamarin.Android 28 [05/31/2019 16:24:31 - eaa614d2-ee8b-4c21-9117-b5f3182cb4d0] (UnknownClient: 0.0.0.0) Is Authority tenantless? - False
[0:] Info: (False) MSAL 3.0.4.0 MSAL.Xamarin.Android 28 [05/31/2019 16:24:31 - eaa614d2-ee8b-4c21-9117-b5f3182cb4d0] (UnknownClient: 0.0.0.0) Checking client info returned from the server..
[0:] Info: (False) MSAL 3.0.4.0 MSAL.Xamarin.Android 28 [05/31/2019 16:24:31 - eaa614d2-ee8b-4c21-9117-b5f3182cb4d0] (UnknownClient: 0.0.0.0) Saving Token Response to cache..
[0:] Info: (False) MSAL 3.0.4.0 MSAL.Xamarin.Android 28 [05/31/2019 16:24:31 - eaa614d2-ee8b-4c21-9117-b5f3182cb4d0] (UnknownClient: 0.0.0.0) Looking for scopes for the authority in the cache which intersect with api://[AppID]/Read
[0:] Info: (False) MSAL 3.0.4.0 MSAL.Xamarin.Android 28 [05/31/2019 16:24:31 - eaa614d2-ee8b-4c21-9117-b5f3182cb4d0] (UnknownClient: 0.0.0.0) Intersecting scope entries count - 1
[0:] Info: (False) MSAL 3.0.4.0 MSAL.Xamarin.Android 28 [05/31/2019 16:24:31 - eaa614d2-ee8b-4c21-9117-b5f3182cb4d0] (UnknownClient: 0.0.0.0) Matching entries after filtering by user - 1
[0:] Info: (False) MSAL 3.0.4.0 MSAL.Xamarin.Android 28 [05/31/2019 16:24:31 - eaa614d2-ee8b-4c21-9117-b5f3182cb4d0] (UnknownClient: 0.0.0.0) Saving RT in cache...
[0:] Info: (False) MSAL 3.0.4.0 MSAL.Xamarin.Android 28 [05/31/2019 16:24:31] (UnknownClient: 0.0.0.0) Deserialized 1 items to token cache.
Here is the code for creating the PCA:
PublicClientApplicationBuilder.Create(ClientId)
.WithAuthority(AzureCloudInstance.AzurePublic, Tenant)
.WithDebugLoggingCallback()
.Build()
The code for acquiring a token follows. Note that WithUseEmbeddedWebView(true) was added in trying to work this problem - didn't seem to make a difference. Also, _msalUiWrapper.MsalUIObject contains a reference to my MainActivity (Xamarin.Forms.Platform.Android.FormsAppCompatActivity) on Android, or my Window.Current (Windows.UI.Xaml.Window) on UWP. It contains null on iOS (which may be a problem later but I'm not testing on iOS yet).
try
{
var accounts = await _publicClientApplication.GetAccountsAsync();
var account = await ChooseAccount(accounts);
AuthResult = await _publicClientApplication.AcquireTokenSilent(App.Scopes, account)
.ExecuteAsync();
}
catch (MsalUiRequiredException ex)
{
try
{
AuthResult = await _publicClientApplication.AcquireTokenInteractive(App.Scopes)
.WithUseEmbeddedWebView(true)
.WithParentActivityOrWindow(_msalUiWrapper.MsalUIObject)
.ExecuteAsync();
}
catch (MsalException msalex)
{
throw new AuthenticationException(msalex);
}
}
Here's the code for signing out:
if (IsSignedIn)
{
await _publicClientApplication.RemoveAsync(AuthResult?.Account);
AuthResult = null;
NotifyOfPropertyChange(() => IsSignedIn);
}
I added the logging code and it yielded better results (there were some long wrapped lines that weren't captured in the logs above).
I redacted the Tenant ID simply because I didn't want it publicly enshrined here forever. Happy to PM it if needed.
[0:] Info:(False) MSAL 3.0.4.0 MSAL.Xamarin.Android 28 [05/31/2019 17:53:59] (UnknownClient: 0.0.0.0) Deserialized 1 items to token cache.
[0:] Info:(False) MSAL 3.0.4.0 MSAL.Xamarin.Android 28 [05/31/2019 17:54:09 - a7d5f98b-6044-4e87-9574-6713dc419a7c] (UnknownClient: 0.0.0.0) MSAL MSAL.Xamarin.Android with assembly version '3.0.4.0', file version '3.0.4.0' and informational version '3.0.4-localbuild+6e60685c88ebf60ce805e58c2b549444870b70be'. TelemetryCorrelationId(a7d5f98b-6044-4e87-9574-6713dc419a7c)
[0:] Info:(False) MSAL 3.0.4.0 MSAL.Xamarin.Android 28 [05/31/2019 17:54:09 - a7d5f98b-6044-4e87-9574-6713dc419a7c] (UnknownClient: 0.0.0.0) === OnBehalfOfParameters ===
[0:] Info:(False) MSAL 3.0.4.0 MSAL.Xamarin.Android 28 [05/31/2019 17:54:09 - a7d5f98b-6044-4e87-9574-6713dc419a7c] (UnknownClient: 0.0.0.0)
[0:] Info:(False) MSAL 3.0.4.0 MSAL.Xamarin.Android 28 [05/31/2019 17:54:09 - a7d5f98b-6044-4e87-9574-6713dc419a7c] (UnknownClient: 0.0.0.0) === Token Acquisition (SilentRequest) started:
[0:] Info:(False) MSAL 3.0.4.0 MSAL.Xamarin.Android 28 [05/31/2019 17:54:10 - a7d5f98b-6044-4e87-9574-6713dc419a7c] (UnknownClient: 0.0.0.0) Looking up access token in the cache.05-31 10:54:10.104 W/View (14608): requestLayout() improperly called by md58432a647068b097f9637064b8985a5e0.NavigationPageRenderer{38b9f77 V.E...... ........ 0,0-1440,2708 #1} during second layout pass: posting in next frame
[0:] Info:(False) MSAL 3.0.4.0 MSAL.Xamarin.Android 28 [05/31/2019 17:54:10 - a7d5f98b-6044-4e87-9574-6713dc419a7c] (UnknownClient: 0.0.0.0) Filtering by home account id item count before 1 after 1
[0:] Info:(False) MSAL 3.0.4.0 MSAL.Xamarin.Android 28 [05/31/2019 17:54:10 - a7d5f98b-6044-4e87-9574-6713dc419a7c] (UnknownClient: 0.0.0.0) Tenant id: company.com
[0:] Info:(False) MSAL 3.0.4.0 MSAL.Xamarin.Android 28 [05/31/2019 17:54:10 - a7d5f98b-6044-4e87-9574-6713dc419a7c] (UnknownClient: 0.0.0.0) Filtering by tenant id item count before 1 after 105-31 10:54:10.183 I/ (14608): (False) MSAL 3.0.4.0 MSAL.Xamarin.Android 28 [05/31/2019 17:54:10 - a7d5f98b-6044-4e87-9574-6713dc419a7c] (UnknownClient: 0.0.0.0) Filtering by tenant id item count before 1 after 1
05-31 10:54:10.194 I/ (14608): (False) MSAL 3.0.4.0 MSAL.Xamarin.Android 28 [05/31/2019 17:54:10 - a7d5f98b-6044-4e87-9574-6713dc419a7c] (UnknownClient: 0.0.0.0) Matching entry count -1[0:] Info:(False) MSAL 3.0.4.0 MSAL.Xamarin.Android 28 [05/31/2019 17:54:10 - a7d5f98b-6044-4e87-9574-6713dc419a7c] (UnknownClient: 0.0.0.0) Matching entry count -1
05-31 10:54:10.221 I/ (14608): (False) MSAL 3.0.4.0 MSAL.Xamarin.Android 28 [05/31/2019 17:54:10 - a7d5f98b-6044-4e87-9574-6713dc419a7c] (UnknownClient: 0.0.0.0) Matching entry count after filtering by scopes - 1[0:] Info:(False) MSAL 3.0.4.0 MSAL.Xamarin.Android 28 [05/31/2019 17:54:10 - a7d5f98b-6044-4e87-9574-6713dc419a7c] (UnknownClient: 0.0.0.0) Matching entry count after filtering by scopes - 1
[0:] Info:(False) MSAL 3.0.4.0 MSAL.Xamarin.Android 28 [05/31/2019 17:54:10 - a7d5f98b-6044-4e87-9574-6713dc419a7c] (UnknownClient: 0.0.0.0) Access token has expired or about to expire. [Current time (05/31/2019 17:54:10) - Expiration Time (05/24/2019 21:33:01 +00:00) - Extended Expiration Time (05/24/2019 21:33:01 +00:00)]
05-31 10:54:10.315 I/ (14608): (False) MSAL 3.0.4.0 MSAL.Xamarin.Android 28 [05/31/2019 17:54:10 - a7d5f98b-6044-4e87-9574-6713dc419a7c] (UnknownClient: 0.0.0.0) Looking up refresh token in the cache..[0:] Info:(False) MSAL 3.0.4.0 MSAL.Xamarin.Android 28 [05/31/2019 17:54:10 - a7d5f98b-6044-4e87-9574-6713dc419a7c] (UnknownClient: 0.0.0.0) Looking up refresh token in the cache..
[0:] Info:(False) MSAL 3.0.4.0 MSAL.Xamarin.Android 28 [05/31/2019 17:54:10 - a7d5f98b-6044-4e87-9574-6713dc419a7c] (UnknownClient: 0.0.0.0) Refresh token found in the cache? - True
05-31 10:54:10.370 I/ (14608): (False) MSAL 3.0.4.0 MSAL.Xamarin.Android 28 [05/31/2019 17:54:10 - a7d5f98b-6044-4e87-9574-6713dc419a7c] (UnknownClient: 0.0.0.0) Resolving authority endpoints... Already resolved? - FALSE[0:] Info:(False) MSAL 3.0.4.0 MSAL.Xamarin.Android 28 [05/31/2019 17:54:10 - a7d5f98b-6044-4e87-9574-6713dc419a7c] (UnknownClient: 0.0.0.0) Resolving authority endpoints... Already resolved? - FALSE
[0:] Info:(False) MSAL 3.0.4.0 MSAL.Xamarin.Android 28 [05/31/2019 17:54:10 - a7d5f98b-6044-4e87-9574-6713dc419a7c] (UnknownClient: 0.0.0.0) Is Authority tenantless? - False05-31 10:54:10.385 I/ (14608): (False) MSAL 3.0.4.0 MSAL.Xamarin.Android 28 [05/31/2019 17:54:10 - a7d5f98b-6044-4e87-9574-6713dc419a7c] (UnknownClient: 0.0.0.0) Is Authority tenantless? - False
[0:] Info:(False) MSAL 3.0.4.0 MSAL.Xamarin.Android 28 [05/31/2019 17:54:10 - a7d5f98b-6044-4e87-9574-6713dc419a7c] (UnknownClient: 0.0.0.0) Checking client info returned from the server..
[0:] Info:(False) MSAL 3.0.4.0 MSAL.Xamarin.Android 28 [05/31/2019 17:54:10 - a7d5f98b-6044-4e87-9574-6713dc419a7c] (UnknownClient: 0.0.0.0) Saving Token Response to cache..
[0:] Info:(False) MSAL 3.0.4.0 MSAL.Xamarin.Android 28 [05/31/2019 17:54:10 - a7d5f98b-6044-4e87-9574-6713dc419a7c] (UnknownClient: 0.0.0.0) Looking for scopes for the authority in the cache which intersect with api://[AppID]/Read
[0:] Info:(False) MSAL 3.0.4.0 MSAL.Xamarin.Android 28 [05/31/2019 17:54:11 - a7d5f98b-6044-4e87-9574-6713dc419a7c] (UnknownClient: 0.0.0.0) Intersecting scope entries count - 1
05-31 10:54:11.016 I/ (14608): (False) MSAL 3.0.4.0 MSAL.Xamarin.Android 28 [05/31/2019 17:54:11 - a7d5f98b-6044-4e87-9574-6713dc419a7c] (UnknownClient: 0.0.0.0) Matching entries after filtering by user - 1[0:] Info:(False) MSAL 3.0.4.0 MSAL.Xamarin.Android 28 [05/31/2019 17:54:11 - a7d5f98b-6044-4e87-9574-6713dc419a7c] (UnknownClient: 0.0.0.0) Matching entries after filtering by user - 1
[0:] Info:(False) MSAL 3.0.4.0 MSAL.Xamarin.Android 28 [05/31/2019 17:54:11 - a7d5f98b-6044-4e87-9574-6713dc419a7c] (UnknownClient: 0.0.0.0) Saving RT in cache...05-31 10:54:11.025 D/Mono (14608): Found as 'java_interop_jnienv_call_void_method'.
[0:] Info:(False) MSAL 3.0.4.0 MSAL.Xamarin.Android 28 [05/31/2019 17:54:11] (UnknownClient: 0.0.0.0) Deserialized 1 items to token cache.
[0:] Info:(False) MSAL 3.0.4.0 MSAL.Xamarin.Android 28 [05/31/2019 17:54:11] (UnknownClient: 0.0.0.0) Serializing token cache with 1 items.
05-31 10:54:11.166 I/ (14608): (False) MSAL 3.0.4.0 MSAL.Xamarin.Android 28 [05/31/2019 17:54:11 - a7d5f98b-6044-4e87-9574-6713dc419a7c] (UnknownClient: 0.0.0.0) === Token Acquisition finished successfully. An access token was returned with Expiration Time: 05/31/2019 18:54:10 +00:00 ===[0:] Info:(False) MSAL 3.0.4.0 MSAL.Xamarin.Android 28 [05/31/2019 17:54:11 - a7d5f98b-6044-4e87-9574-6713dc419a7c] (UnknownClient: 0.0.0.0) === Token Acquisition finished successfully. An access token was returned with Expiration Time: 05/31/2019 18:54:10 +00:00 ===
@ericcox thanks. much appreciated. Could you update to MSAL 3.0.8 and see if the issue repros there as well? And then include the logs for 3.0.8. Sorry, didn't notice this earlier when you sent the first set of logs. Thank you!
@jennyf19 That's strange, I was so certain I was on 3.0.8 already...
Anyway - I removed references to the locally-built libraries and referenced 3.0.8 from Nuget again.
The lines marked with "=== MSAL ===" are coming through the .WithLogging() mechanism. I assume the rest are being dumped to debug output directly by the MSAL libraries.
[0:] === MSAL === (False) MSAL 3.0.8.0 MSAL.Xamarin.Android 28 [05/31/2019 23:02:09] Deserialized 1 items to token cache.
05-31 16:02:25.085 I/ ( 5497): (False) MSAL 3.0.8.0 MSAL.Xamarin.Android 28 [05/31/2019 23:02:25 - 212dae1b-91df-4ee0-be97-a8c2283f7c2d] MSAL MSAL.Xamarin.Android with assembly version '3.0.8.0', file version '3.0.8.0' and informational version '3.0.8+5db620ee347d54948b2775699985ae7a4d2bef1a'. TelemetryCorrelationId(212dae1b-91df-4ee0-be97-a8c2283f7c2d)
[0:] === MSAL === (False) MSAL 3.0.8.0 MSAL.Xamarin.Android 28 [05/31/2019 23:02:25 - 212dae1b-91df-4ee0-be97-a8c2283f7c2d] MSAL MSAL.Xamarin.Android with assembly version '3.0.8.0', file version '3.0.8.0' and informational version '3.0.8+5db620ee347d54948b2775699985ae7a4d2bef1a'. TelemetryCorrelationId(212dae1b-91df-4ee0-be97-a8c2283f7c2d)
05-31 16:02:25.114 I/ ( 5497): (False) MSAL 3.0.8.0 MSAL.Xamarin.Android 28 [05/31/2019 23:02:25 - 212dae1b-91df-4ee0-be97-a8c2283f7c2d] === OnBehalfOfParameters ===
[0:] === MSAL === (False) MSAL 3.0.8.0 MSAL.Xamarin.Android 28 [05/31/2019 23:02:25 - 212dae1b-91df-4ee0-be97-a8c2283f7c2d] === OnBehalfOfParameters ===
LoginHint provided: False
User provided: True
ForceRefresh: False05-31 16:02:25.114 I/ ( 5497): LoginHint provided: False
05-31 16:02:25.114 I/ ( 5497): User provided: True
05-31 16:02:25.114 I/ ( 5497): ForceRefresh: False
05-31 16:02:25.171 I/ ( 5497): (False) MSAL 3.0.8.0 MSAL.Xamarin.Android 28 [05/31/2019 23:02:25 - 212dae1b-91df-4ee0-be97-a8c2283f7c2d]
05-31 16:02:25.171 I/ ( 5497): === Request Data ===[0:] === MSAL === (False) MSAL 3.0.8.0 MSAL.Xamarin.Android 28 [05/31/2019 23:02:25 - 212dae1b-91df-4ee0-be97-a8c2283f7c2d]
=== Request Data ===
Authority Provided? - True
Scopes - api://[AppID]/Read
Extra Query Params Keys (space separated) -
05-31 16:02:25.171 I/ ( 5497): Authority Provided? - True
05-31 16:02:25.171 I/ ( 5497): Scopes - api://[AppID]/Read
05-31 16:02:25.171 I/ ( 5497): Extra Query Params Keys (space separated) -
05-31 16:02:25.180 I/ ( 5497): (False) MSAL 3.0.8.0 MSAL.Xamarin.Android 28 [05/31/2019 23:02:25 - 212dae1b-91df-4ee0-be97-a8c2283f7c2d] === Token Acquisition (SilentRequest) started:
05-31 16:02:25.180 I/ ( 5497): Cache Provided: True
[0:] === MSAL === (False) MSAL 3.0.8.0 MSAL.Xamarin.Android 28 [05/31/2019 23:02:25 - 212dae1b-91df-4ee0-be97-a8c2283f7c2d] === Token Acquisition (SilentRequest) started:
Cache Provided: True
Authority Host: login.microsoftonline.com05-31 16:02:25.180 I/ ( 5497): Authority Host: login.microsoftonline.com
05-31 16:02:25.232 D/NetworkSecurityConfig( 5497): No Network Security Config specified, using platform default
05-31 16:02:25.967 I/ ( 5497): (False) MSAL 3.0.8.0 MSAL.Xamarin.Android 28 [05/31/2019 23:02:25 - 212dae1b-91df-4ee0-be97-a8c2283f7c2d] Looking up access token in the cache.
[0:] === MSAL === (False) MSAL 3.0.8.0 MSAL.Xamarin.Android 28 [05/31/2019 23:02:25 - 212dae1b-91df-4ee0-be97-a8c2283f7c2d] Looking up access token in the cache.
05-31 16:02:25.982 I/ ( 5497): (False) MSAL 3.0.8.0 MSAL.Xamarin.Android 28 [05/31/2019 23:02:25 - 212dae1b-91df-4ee0-be97-a8c2283f7c2d] Filtering by home account id item count before 1 after 1
[0:] === MSAL === (False) MSAL 3.0.8.0 MSAL.Xamarin.Android 28 [05/31/2019 23:02:25 - 212dae1b-91df-4ee0-be97-a8c2283f7c2d] Filtering by home account id item count before 1 after 1
05-31 16:02:25.997 I/ ( 5497): (False) MSAL 3.0.8.0 MSAL.Xamarin.Android 28 [05/31/2019 23:02:25 - 212dae1b-91df-4ee0-be97-a8c2283f7c2d] Tenant id: [company].com
[0:] === MSAL === (False) MSAL 3.0.8.0 MSAL.Xamarin.Android 28 [05/31/2019 23:02:25 - 212dae1b-91df-4ee0-be97-a8c2283f7c2d] Tenant id: [company].com
05-31 16:02:26.010 I/ ( 5497): (False) MSAL 3.0.8.0 MSAL.Xamarin.Android 28 [05/31/2019 23:02:26 - 212dae1b-91df-4ee0-be97-a8c2283f7c2d] Filtering by tenant id item count before 1 after 1[0:] === MSAL === (False) MSAL 3.0.8.0 MSAL.Xamarin.Android 28 [05/31/2019 23:02:26 - 212dae1b-91df-4ee0-be97-a8c2283f7c2d] Filtering by tenant id item count before 1 after 1
05-31 16:02:26.031 I/ ( 5497): (False) MSAL 3.0.8.0 MSAL.Xamarin.Android 28 [05/31/2019 23:02:26 - 212dae1b-91df-4ee0-be97-a8c2283f7c2d] Matching entry count -1
[0:] === MSAL === (False) MSAL 3.0.8.0 MSAL.Xamarin.Android 28 [05/31/2019 23:02:26 - 212dae1b-91df-4ee0-be97-a8c2283f7c2d] Matching entry count -1
05-31 16:02:26.049 I/ ( 5497): (False) MSAL 3.0.8.0 MSAL.Xamarin.Android 28 [05/31/2019 23:02:26 - 212dae1b-91df-4ee0-be97-a8c2283f7c2d] Matching entry count after filtering by scopes - 1
[0:] === MSAL === (False) MSAL 3.0.8.0 MSAL.Xamarin.Android 28 [05/31/2019 23:02:26 - 212dae1b-91df-4ee0-be97-a8c2283f7c2d] Matching entry count after filtering by scopes - 1
05-31 16:02:26.086 I/ ( 5497): (False) MSAL 3.0.8.0 MSAL.Xamarin.Android 28 [05/31/2019 23:02:26 - 212dae1b-91df-4ee0-be97-a8c2283f7c2d] Access token has expired or about to expire. [Current time (05/31/2019 23:02:26) - Expiration Time (05/24/2019 21:33:01 +00:00) - Extended Expiration Time (05/24/2019 21:33:01 +00:00)]
[0:] === MSAL === (False) MSAL 3.0.8.0 MSAL.Xamarin.Android 28 [05/31/2019 23:02:26 - 212dae1b-91df-4ee0-be97-a8c2283f7c2d] Access token has expired or about to expire. [Current time (05/31/2019 23:02:26) - Expiration Time (05/24/2019 21:33:01 +00:00) - Extended Expiration Time (05/24/2019 21:33:01 +00:00)]
05-31 16:02:26.119 I/ ( 5497): (False) MSAL 3.0.8.0 MSAL.Xamarin.Android 28 [05/31/2019 23:02:26 - 212dae1b-91df-4ee0-be97-a8c2283f7c2d] Looking up refresh token in the cache..
[0:] === MSAL === (False) MSAL 3.0.8.0 MSAL.Xamarin.Android 28 [05/31/2019 23:02:26 - 212dae1b-91df-4ee0-be97-a8c2283f7c2d] Looking up refresh token in the cache..
05-31 16:02:26.133 I/ ( 5497): (False) MSAL 3.0.8.0 MSAL.Xamarin.Android 28 [05/31/2019 23:02:26 - 212dae1b-91df-4ee0-be97-a8c2283f7c2d] Refresh token found in the cache? - True
[0:] === MSAL === (False) MSAL 3.0.8.0 MSAL.Xamarin.Android 28 [05/31/2019 23:02:26 - 212dae1b-91df-4ee0-be97-a8c2283f7c2d] Refresh token found in the cache? - True
05-31 16:02:26.150 I/ ( 5497): (False) MSAL 3.0.8.0 MSAL.Xamarin.Android 28 [05/31/2019 23:02:26 - 212dae1b-91df-4ee0-be97-a8c2283f7c2d] Resolving authority endpoints... Already resolved? - FALSE
[0:] === MSAL === (False) MSAL 3.0.8.0 MSAL.Xamarin.Android 28 [05/31/2019 23:02:26 - 212dae1b-91df-4ee0-be97-a8c2283f7c2d] Resolving authority endpoints... Already resolved? - FALSE
05-31 16:02:26.175 I/ ( 5497): (False) MSAL 3.0.8.0 MSAL.Xamarin.Android 28 [05/31/2019 23:02:26 - 212dae1b-91df-4ee0-be97-a8c2283f7c2d] Is Authority tenantless? - False
[0:] === MSAL === (False) MSAL 3.0.8.0 MSAL.Xamarin.Android 28 [05/31/2019 23:02:26 - 212dae1b-91df-4ee0-be97-a8c2283f7c2d] Is Authority tenantless? - False
05-31 16:02:26.779 I/ ( 5497): (False) MSAL 3.0.8.0 MSAL.Xamarin.Android 28 [05/31/2019 23:02:26 - 212dae1b-91df-4ee0-be97-a8c2283f7c2d] Checking client info returned from the server..
[0:] === MSAL === (False) MSAL 3.0.8.0 MSAL.Xamarin.Android 28 [05/31/2019 23:02:26 - 212dae1b-91df-4ee0-be97-a8c2283f7c2d] Checking client info returned from the server..
05-31 16:02:26.803 I/ ( 5497): (False) MSAL 3.0.8.0 MSAL.Xamarin.Android 28 [05/31/2019 23:02:26 - 212dae1b-91df-4ee0-be97-a8c2283f7c2d] Saving Token Response to cache..
[0:] === MSAL === (False) MSAL 3.0.8.0 MSAL.Xamarin.Android 28 [05/31/2019 23:02:26 - 212dae1b-91df-4ee0-be97-a8c2283f7c2d] Saving Token Response to cache..
05-31 16:02:26.831 I/ ( 5497): (False) MSAL 3.0.8.0 MSAL.Xamarin.Android 28 [05/31/2019 23:02:26 - 212dae1b-91df-4ee0-be97-a8c2283f7c2d] Looking for scopes for the authority in the cache which intersect with api://[AppID]/Read
[0:] === MSAL === (False) MSAL 3.0.8.0 MSAL.Xamarin.Android 28 [05/31/2019 23:02:26 - 212dae1b-91df-4ee0-be97-a8c2283f7c2d] Looking for scopes for the authority in the cache which intersect with api://[AppID]/Read
05-31 16:02:26.858 I/ ( 5497): (False) MSAL 3.0.8.0 MSAL.Xamarin.Android 28 [05/31/2019 23:02:26 - 212dae1b-91df-4ee0-be97-a8c2283f7c2d] Intersecting scope entries count - 1
[0:] === MSAL === (False) MSAL 3.0.8.0 MSAL.Xamarin.Android 28 [05/31/2019 23:02:26 - 212dae1b-91df-4ee0-be97-a8c2283f7c2d] Intersecting scope entries count - 1
05-31 16:02:26.880 I/ ( 5497): (False) MSAL 3.0.8.0 MSAL.Xamarin.Android 28 [05/31/2019 23:02:26 - 212dae1b-91df-4ee0-be97-a8c2283f7c2d] Matching entries after filtering by user - 1
[0:] === MSAL === (False) MSAL 3.0.8.0 MSAL.Xamarin.Android 28 [05/31/2019 23:02:26 - 212dae1b-91df-4ee0-be97-a8c2283f7c2d] Matching entries after filtering by user - 1
05-31 16:02:26.961 I/ ( 5497): (False) MSAL 3.0.8.0 MSAL.Xamarin.Android 28 [05/31/2019 23:02:26 - 212dae1b-91df-4ee0-be97-a8c2283f7c2d] Saving RT in cache...
[0:] === MSAL === (False) MSAL 3.0.8.0 MSAL.Xamarin.Android 28 [05/31/2019 23:02:26 - 212dae1b-91df-4ee0-be97-a8c2283f7c2d] Saving RT in cache...
05-31 16:02:27.009 I/ ( 5497): (False) MSAL 3.0.8.0 MSAL.Xamarin.Android 28 [05/31/2019 23:02:27] Deserialized 1 items to token cache.
[0:] === MSAL === (False) MSAL 3.0.8.0 MSAL.Xamarin.Android 28 [05/31/2019 23:02:27] Deserialized 1 items to token cache.
05-31 16:02:27.020 I/ ( 5497): (False) MSAL 3.0.8.0 MSAL.Xamarin.Android 28 [05/31/2019 23:02:27] Serializing token cache with 1 items.
[0:] === MSAL === (False) MSAL 3.0.8.0 MSAL.Xamarin.Android 28 [05/31/2019 23:02:27] Serializing token cache with 1 items.
05-31 16:02:27.095 I/ ( 5497): (False) MSAL 3.0.8.0 MSAL.Xamarin.Android 28 [05/31/2019 23:02:27 - 212dae1b-91df-4ee0-be97-a8c2283f7c2d] === Token Acquisition finished successfully. An access token was returned with Expiration Time: 06/01/2019 00:02:26 +00:00 ===
[0:] === MSAL === (False) MSAL 3.0.8.0 MSAL.Xamarin.Android 28 [05/31/2019 23:02:27 - 212dae1b-91df-4ee0-be97-a8c2283f7c2d] === Token Acquisition finished successfully. An access token was returned with Expiration Time: 06/01/2019 00:02:26 +00:00 ===
@ericcox again...thanks!
@jennyf19 Oops, I forgot to capture logs during the RemoveAsync() call. Here they are:
05-31 16:23:18.324 I/ (11979): (False) MSAL 3.0.8.0 MSAL.Xamarin.Android 28 [05/31/2019 23:23:18 - 436de1c1-d51b-4db4-8edb-c35ea9bb766c] Removing user from cache..
[0:] === MSAL === (False) MSAL 3.0.8.0 MSAL.Xamarin.Android 28 [05/31/2019 23:23:18 - 436de1c1-d51b-4db4-8edb-c35ea9bb766c] Removing user from cache..
05-31 16:23:18.360 I/ (11979): (False) MSAL 3.0.8.0 MSAL.Xamarin.Android 28 [05/31/2019 23:23:18 - 436de1c1-d51b-4db4-8edb-c35ea9bb766c] Deleted refresh token count - 1
[0:] === MSAL === (False) MSAL 3.0.8.0 MSAL.Xamarin.Android 28 [05/31/2019 23:23:18 - 436de1c1-d51b-4db4-8edb-c35ea9bb766c] Deleted refresh token count - 1
05-31 16:23:18.382 I/ (11979): (False) MSAL 3.0.8.0 MSAL.Xamarin.Android 28 [05/31/2019 23:23:18 - 436de1c1-d51b-4db4-8edb-c35ea9bb766c] Deleted access token count - 1[0:] === MSAL === (False) MSAL 3.0.8.0 MSAL.Xamarin.Android 28 [05/31/2019 23:23:18 - 436de1c1-d51b-4db4-8edb-c35ea9bb766c] Deleted access token count - 1
05-31 16:23:18.438 I/ (11979): (False) MSAL 3.0.8.0 MSAL.Xamarin.Android 28 [05/31/2019 23:23:18 - 436de1c1-d51b-4db4-8edb-c35ea9bb766c] Deleted Id token count - 1
[0:] === MSAL === (False) MSAL 3.0.8.0 MSAL.Xamarin.Android 28 [05/31/2019 23:23:18 - 436de1c1-d51b-4db4-8edb-c35ea9bb766c] Deleted Id token count - 1
05-31 16:23:18.471 I/ (11979): (False) MSAL 3.0.8.0 MSAL.Xamarin.Android 28 [05/31/2019 23:23:18] Deserialized 1 items to token cache.
[0:] === MSAL === (False) MSAL 3.0.8.0 MSAL.Xamarin.Android 28 [05/31/2019 23:23:18] Deserialized 1 items to token cache.
05-31 16:23:18.493 I/ (11979): (False) MSAL 3.0.8.0 MSAL.Xamarin.Android 28 [05/31/2019 23:23:18] Serializing token cache with 0 items.
[0:] === MSAL === (False) MSAL 3.0.8.0 MSAL.Xamarin.Android 28 [05/31/2019 23:23:18] Serializing token cache with 0 items.
Have a great weekend!
@ericcox I was unable to repro this issue today. I used MSAL 4.1, and both system webview and embedded browser with two different users. I followed your repro steps (which are great) but when I cleared the cache and reloaded the app, I did not have any users present.
Do you have a link to a repro or a zip file you can send us? Also, could you try w/4.1 and see if it still repros for you? I did not try with 3.0.8 (sorry this issue has taken us awhile to get around to).
@ericcox : Closing, please re-open and provide additional infor if this is still an issue.