Skip to content
This repository has been archived by the owner on Jun 30, 2023. It is now read-only.

When asking for a token to a different resource through a broker, the token cache deletes the original AT #1463

Closed
bgavrilMS opened this issue Dec 17, 2018 · 1 comment
Assignees
Labels
Milestone

Comments

@bgavrilMS
Copy link
Member

bgavrilMS commented Dec 17, 2018

Which Version of ADAL are you using ?
Note that to get help, you need to run the latest preview or non-preview version
For MSAL, please log issues to https://github.com/AzureAD/microsoft-authentication-library-for-dotnet
latest

Which platform has the issue?
Android, possibly iOS (?)

What authentication flow has the issue?
Other: AcquireTokenInternactive + AcquireTokenSilent via broker

Repro

  1. AcquireTokenInteractive resource1 (via broker)
    Actual: adds an AT and IdT to the cache, but the RT (which is an MRRT) is stored by the broker. This is expected.

  2. AcquireTokenSilent resource2 (via broker) - a silent broker calls is happening, but the original AT is deleted

  3. Look at the token cache.

Expected behavior
The token cache should still contain the AT obtained from step1

Actual behavior
The token cache deletes the AT obtained from step1

User Impact
The impact is not significant because the logic falls back to a silent broker call will also produce a token. However this is slower than fetching the result from the token cache.

What is actually happening

a. The tokenCache holds an entry, but this entry is not resource specific and no MRRT exists because borkers hold onto the MRRT
b. The tokenCache continues to look at the original AT
c. The tokenCache continues to think there is an MRRT available locally
d. The token cache deletes the original AT because it thinks it is old

@bgavrilMS
Copy link
Member Author

Fixed

@jennyf19 jennyf19 added this to the 4.5.0 milestone Jan 16, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants