Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[Bug] Once the region discovery is done calls with WithAzureRegion set to false should not hit the regional token endpoint #2260

Closed
neha-bhargava opened this issue Dec 1, 2020 · 3 comments · Fixed by #2308
Assignees
Labels
Milestone

Comments

@neha-bhargava
Copy link
Contributor

Which Version of MSAL are you using ?

Latest

Repro

// 1st call with regional auth set to true
await cca.AcquireTokenForClient(scopes) .WithAzureRegion(true);

// 2nd call to global
await cca.AcquireTokenForClient(scopes) .WithAzureRegion(false);

Expected behavior
The 2nd call should go to global token endpoint.

Actual behavior
The 2nd call is going to regional token endpoint.

Possible Solution
This is happening because we are caching the network metadata with preferred network as the regional endpoint once the region is discovered for both the original authority and the authority created with the region.

Either cache the regional metadata separate, or cache it only for the regional authority.

@neha-bhargava neha-bhargava self-assigned this Dec 1, 2020
@neha-bhargava neha-bhargava changed the title [Bug] Once the region discovery is done calls with WithAzureRegion set to false also hit the regional token endpoint [Bug] Once the region discovery is done calls with WithAzureRegion set to false should not hit the regional token endpoint Dec 1, 2020
@neha-bhargava neha-bhargava added P1 and removed P2 labels Dec 15, 2020
@neha-bhargava
Copy link
Contributor Author

Marking it as P1 since the network metadata cache is a static cache and once the region is discovered we will be hitting the regional endpoint irrespective of the value for WithAzureRegion. This could cause problems if someone wants to fallback to global in case ests-r endpoint fails or if someone wants to rollout traffic to ests-r in phases.

@jmprieur
Copy link
Contributor

Reopenining the issue closed by the bot (until we release it)

@pmaytak
Copy link
Contributor

pmaytak commented Jan 20, 2021

This is included in MSAL 4.25.0 release.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants