Skip to content
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

[Investigate] Incorrect behavior using the issuer validator cache in AadIssuerValidator class #51

Closed
pmaytak opened this issue Mar 11, 2020 · 3 comments
Assignees
Milestone

Comments

@pmaytak
Copy link
Contributor

pmaytak commented Mar 11, 2020

The authority in public static AadIssuerValidator GetIssuerValidator(string aadAuthority) is in the form of URI (ex. https://login.microsoftonline.com/).

In if (s_issuerValidators.TryGetValue(aadAuthority, out AadIssuerValidator aadIssuerValidator)) full authority string is used to query the issuer validator dictionary.

However, only the authority host is used as a key to insert the value.

string authority = authorityHost ?? new Uri(FallbackAuthority).Host;
...
s_issuerValidators[authority] = new AadIssuerValidator(aliases);

So the value is never retrieved in the cache, unless only the host is passed in while the cache has that key.
Investigate if this behavior is intended.

@jmprieur jmprieur added the bug Something isn't working label Mar 24, 2020
@jmprieur
Copy link
Collaborator

@pmaytak
when you are tired of writing tests, do you want to have a go at fixing it?

@pmaytak
Copy link
Contributor Author

pmaytak commented Mar 24, 2020

Oui.

@jmprieur
Copy link
Collaborator

jmprieur commented May 7, 2020

Fixed in Microsoft.Identity.Web 0.1.2-preview

@jmprieur jmprieur closed this as completed May 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants