azure - 具有角度的 MSAL 无法进行身份验证 - 尝试发现实例时失败

标签 azure azure-active-directory msal.js

在使用 SSO 通过 MSAL 和 Angular 登录 Azure 时,我被重定向到此 URL:https://login.microsoftonline.com/common//discovery/instance?api-version=1.1&authorization_endpoint=https://login.microsoftonline.com/{tenant}/{organization}.onmicrosoft.com/{policyName}/oauth2/v2.0/authorize端点。

...响应是 - 400 bad request errorinvalid_request(在 xhr 中)

curl 返回时出现以下错误: “error”:“invalid_request”,“error_description”:“AADSTS50050:请求格式错误:“authorization_endpoint”格式无效

为什么新用户会发生这种情况?

更新:

MsalModule.forRoot(
      {
        auth: {
          ...
          validateAuthority: false,
          ...
        },
...

设置validateAuthority: false暂时解决了这个问题。 但是,设置 validateAuthority 不应导致问题 - 这只是一种解决方法。

最佳答案

如果您使用的是 Azure AD,请尝试将您的 authorization_endpoint 更改为

https://login.microsoftonline.com/{tenant}/oauth2/v2.0/authorize

策略名称始终用于 Azure AD B2C,格式如下:https://{your-B2C-tenant-name}.b2clogin.com/{organization}.onmicrosoft.com/{policyName}/oauth2/v2.0/授权

关于azure - 具有角度的 MSAL 无法进行身份验证 - 尝试发现实例时失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65498327/

相关文章:

azure - 在 Azure 上设置 Jenkins、Docker、Kubernetes ci/cd

azure - 更改 Azure Data Lake Store 的加密 key

c# - 应用程序洞察中自定义对象的属性在哪里

c# - 使用密码和 Azure Active Directory 身份验证的 Asp.net Identity

azure - Microsoft 授权端点 - 添加 Dynamics 365 Business Central 权限

azure - msal.js loginRedirect() 重复重定向到登录窗口react.js

authentication - 是否可以使用 MSAL.js 来获取刷新 token ?

c# - 查找 Azure Blob 存储中所有带前缀的 Blob

azure - 无法访问 onedrive

azure - @azure/msal-browser TypeError : this. startPerformanceMeasurement 不是函数