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

Azure Region not prepended to the endpoint while using ESTS-R with Microsoft.Identity.Web 1.19.0 #1535

Closed
2 of 8 tasks
sangs-msft opened this issue Nov 18, 2021 · 1 comment · Fixed by #1534
Closed
2 of 8 tasks
Labels
ADAL-to-MSAL-migration-blocker bug Something isn't working fixed regression regression between Microsoft Identity Web versions resiliency
Milestone

Comments

@sangs-msft
Copy link

Which version of Microsoft Identity Web are you using?
E.g. Microsoft Identity Web 1.19.0

Where is the issue?

  • Web app
    • Sign-in users
    • Sign-in users and call web APIs
  • Web API
    • Protected web APIs (validating tokens)
    • Protected web APIs (validating scopes)
    • Protected web APIs call downstream web APIs
  • Token cache serialization
    • In-memory caches
    • Session caches
    • Distributed caches
  • Other (please describe)

Is this a new or an existing app?
a. The app is in production using the old version and I have upgraded to a new version of Microsoft Identity Web to incorporate ESTS-R changes

Repro
In order to repo, use the code snippet mentioned here https://identitydocs.azurewebsites.net/static/v2/msal-net-regional-adoption.html#providing-a-region-with-microsoftidentityweb to enable ESTS-R

      services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
          .AddMicrosoftIdentityWebApi(
              configureJwtBearerOptions: jwtOptions => { },
              configureMicrosoftIdentityOptions: msIdentityOptions =>
              {
                  msIdentityOptions.Instance = options.AuthenticationEndpoint.AbsoluteUri;
                  msIdentityOptions.TenantId = options.DefaultTenantId;
                  msIdentityOptions.SendX5C = true;
                  msIdentityOptions.ClientId = options.ClientApplicationId;
                  msIdentityOptions.ClientCertificates = new[]
                  {
                      CertificateDescription.FromStoreWithDistinguishedName(options.ClientCertificateSubjectName, StoreLocation.LocalMachine, StoreName.My),
                  };
              })
          .EnableTokenAcquisitionToCallDownstreamApi(configureConfidentialClientApplicationOptions: clientAppOptions => { })
          .AddInMemoryTokenCaches();
      services.Configure<ConfidentialClientApplicationOptions>(
          JwtBearerDefaults.AuthenticationScheme,
          applicationOptions => { applicationOptions.AzureRegion = options.Region; });

**Expected behavior**
It is expected that we hit the regional endpoint to acquire token. 
Ex - https://centraluseuap.login.microsoft.com

**Actual behavior**
We are hitting the global endpoint in spite of enabling ESTS-R 
https://login.microsoft.com


**Additional context / logs / screenshots / link to code**
<!-- Please do not include any customer data or Personal Identifiable Information (PII) in any content posted to GitHub. See https://docs.microsoft.com/en-us/compliance/regulatory/gdpr#gdpr-faqs for more info on PII.-->
Add any other context about the problem here, such as logs and screenshots, or even links to code.
@sangs-msft sangs-msft changed the title Azure Region not prepended to the endpoint while using Microsoft.Identity.Web 1.19.0 Azure Region not prepended to the endpoint while using ESTS-R with Microsoft.Identity.Web 1.19.0 Nov 18, 2021
@jennyf19 jennyf19 added fixed regression regression between Microsoft Identity Web versions resiliency labels Nov 18, 2021
@jennyf19 jennyf19 added the bug Something isn't working label Nov 18, 2021
@jmprieur jmprieur linked a pull request Nov 19, 2021 that will close this issue
@jennyf19 jennyf19 added this to the 1.21.0 milestone Nov 20, 2021
@jennyf19
Copy link
Collaborator

Included in 1.21.0 release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ADAL-to-MSAL-migration-blocker bug Something isn't working fixed regression regression between Microsoft Identity Web versions resiliency
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants