node.js - ADAL 节点:未找到租户组织
问题描述
如果授权 url 类似于 https://login.microsoftonline.com/domainName(其中域名是与您的租户关联的域),我会收到以下错误
获取令牌请求返回 http 错误:400 和服务器响应:错误描述 AADSTS90002 未找到租户“组织”如果租户没有活动订阅,则可能会发生这种情况。检查以确保您拥有正确的租户 ID
如果 authority_url 类似于 https://login.microsoftonline.com/{Guid}(其中 Guid 是租户 ID),则代码可以正常工作
示例代码:
var authorityUrl = 'https://login.microsoftonline.com/organizations';
var authContext = new AuthenticationContext(authorityUrl, undefined, undefined, '');
var token = await this.authContext.acquireTokenWithClientCredentials(this.resourceId, this.clientId, this.clientSecret);
使用“adal-node”:“0.2.1”
解决方案
错误消息指出您指定的租户(“组织”)不存在。请尝试提供有效的租户名称。
即https://login.microsoftonline.com/YourOrgName.onmicrosoft.com,其中“YourOrgName.onmicrosoft.com”应替换为您的租户名称。
推荐阅读
- c++11 - 函数“if constexpr”和“else if constexpr”的返回
- django - 如何通过从另一个模型的 OneToOneField 继承的字段进行查找
- java - Java .dat 文件到 Python 泡菜
- javascript - 如何在文本视图输入中插入数字/文本?
- postgresql - 如何根据当前时间更新列的值?
- java - 有没有办法使用文本输入在目录中搜索文本文件的名称?
- angular - 如何在角度分量中添加延迟?
- javascript - 角材料数据表不显示服务数据
- python - 无法在定义之外保存变量
- multithreading - Spark 并行运行多个操作