Azure / azure-sdk-for-js

This repository is for active development of the Azure SDK for JavaScript (NodeJS & Browser). For consumers of the SDK we recommend visiting our public developer docs at https://docs.microsoft.com/javascript/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-js.
MIT License
2.07k stars 1.19k forks source link

can not validate the authority #30684

Open yourdearconner opened 2 months ago

yourdearconner commented 2 months ago

Describe the bug the regrex can not match my domain "login.partner.microsoftonline.cn" as you see it only match the domain with 3 dots the regrex should match with a dns standard

// @azure/identity/dist-esm/src/msal/utils.js
export function publicToMsal(account) {
  const [environment] = account.authority.match(/([a-z]*\.[a-z]*\.[a-z]*)/) || [""];
  return Object.assign(Object.assign({}, account), {
    localAccountId: account.homeAccountId,
    environment
  });
}

To Reproduce Steps to reproduce the behavior:

Expected behavior A clear and concise description of what you expected to happen.

Screenshots

Additional context Add any other context about the problem here.

github-actions[bot] commented 2 months ago

@KarishmaGhiya @maorleger

github-actions[bot] commented 2 months ago

Thank you for your feedback. Tagging and routing to the team member best able to assist.

KarishmaGhiya commented 6 days ago

@minhanh-phan i'll check with the msal team what the valid default value for environment is as Jeremy asked here. https://github.com/Azure/azure-sdk-for-js/pull/25429/files#r1811578173

We can update that as well as the regex to reflect a valid url