有没有办法在 MSAL.js 中查找身份验证是遵循 MSA 还是 Azure AD
Is there a way to find whether authentication followed MSA or Azure AD in MSAL.js
我尝试使用此处提供的代码:https://github.com/Azure-Samples/active-directory-javascript-singlepageapp-dotnet-webapi-v2
它适用于 MSA 和 Azure AD 身份验证。我需要知道输入的电子邮件地址是 MSA 还是 Azure AD。有没有办法从响应中找出答案?
在您返回的 id_token 中,有一个 iss
(发行人)声明。
此声明包含用户的租户。
如果用户使用 Microsoft 帐户 (MSA),他们的颁发者声明将包含 MSA 租户的以下 GUID:9188040d-6c67-4c5b-b112-36a304b66dad
发行人的全部价值将为:
https://login.microsoftonline.com/9188040d-6c67-4c5b-b112-36a304b66dad/v2.0
任何其他 GUID 表示用户使用 Azure AD 登录,GUID 值将代表他们的 Azure AD 租户。
有关详细信息,请查看 Token Reference 文档的 id_token 部分。
我尝试使用此处提供的代码:https://github.com/Azure-Samples/active-directory-javascript-singlepageapp-dotnet-webapi-v2
它适用于 MSA 和 Azure AD 身份验证。我需要知道输入的电子邮件地址是 MSA 还是 Azure AD。有没有办法从响应中找出答案?
在您返回的 id_token 中,有一个 iss
(发行人)声明。
此声明包含用户的租户。
如果用户使用 Microsoft 帐户 (MSA),他们的颁发者声明将包含 MSA 租户的以下 GUID:9188040d-6c67-4c5b-b112-36a304b66dad
发行人的全部价值将为:
https://login.microsoftonline.com/9188040d-6c67-4c5b-b112-36a304b66dad/v2.0
任何其他 GUID 表示用户使用 Azure AD 登录,GUID 值将代表他们的 Azure AD 租户。
有关详细信息,请查看 Token Reference 文档的 id_token 部分。