javascript - AADSTS50011:请求中指定的回复 URL 与为应用程序配置的回复 URL 不匹配:
问题描述
我msal
用来验证用户。
我的userAgentApplication
样子是这样的:
var userAgentApplication = new UserAgentApplication({
auth: {
clientId: config.appId,
authority: config.authority,
validateAuthority: false,
},
cache: {
cacheLocation: "localStorage",
storeAuthStateInCookie: true,
},
});
这是我的config.js
modules.exports = {
appId: "<my-App-id>",
authority:
"https://login.microsoftonline.com/<my-Tenant-id>/",
scopes: ["user.read", "calendars.read"],
};
我一直遇到这个错误,我不知道为什么会这样。
Request Id: 38b5b62e-0407-4520-8319-157b9c2e3e00
Correlation Id: 143c20c5-4cab-41be-aded-14daa783d022
Timestamp: 2020-04-06T07:21:35Z
Message: AADSTS50011: The reply URL specified in the request does not match the reply URLs configured for the application: 'xxxxxxxxxx'.
解决方案
auth.redirectUri
实例化时如果不设置UserAgentApplication
,msal
会使用当前页面的url作为redirectUri
每个请求设置的url,使用的页面redirectUri
都必须在Azure Portal中注册。您需要设置auth.redirectUri
为在 Azure 门户中注册的 url,或者将应用程序中的所有页面注册为可能的重定向 uri(可能不太可取)。
推荐阅读
- android - 具有不同样式的默认警报对话框
- java - Micronaut:测试失败,页面未找到,但可以通过浏览器正常访问页面
- html - 画布内卡片的最大尺寸
- ios - AVPlayerLooper 没有循环播放我的本地视频
- python - Keras LSTM如何使用多对多的模型进行训练以进行有状态=真的一对多的预测?
- javascript - 在javascript中合并2个查询
- ruby-on-rails - 关于 Rails 5 安全性的一些问题
- opengl - 为什么多边形必须简单且凸?
- powerapps - 如何选择下拉值并在 Powerapp 的标签上显示其他值?
- php - PHP函数将Font Awesome完整性密钥添加到css文件