AADSTS50058 调用 AAD 时导致刷新循环
AADSTS50058 when calling AAD causes refresh loops
有时我在从 Angular.
调用 Azure Active Directory Graph API 时收到错误 AADSTS50058
我的设置:
- adal-angular1.0.13
- angular v1.5.8
- google chrome 'Block 3rd party cookies'
上没有标记
- 尝试启用 KMSI 标志
- Chrome(最新)
上没有阻止 cookie 的扩展
- 更新 : 路由包 "angular-route"
这是代码:
var my_endpoints = {
'https ://graph.windows.net/': 'https ://graph.windows.net/'
};
adalProvider.init({
instance: 'https ://login.microsoftonline.com/',
tenant: "common",
clientId: '[my-client-ID-here]',
extraQueryParameter: 'nux=1',
cacheLocation: 'sessionStorage',
endpoints: my_endpoints
}, $httpProvider);
n.b.: https 链接没有 space, 我设置这个是因为 Whosebug.
这是我无法解决的错误:
错误 AADSTS50058:发送了静默登录请求,但没有用户登录。用于表示用户会话的 cookie 未在发送到 Azure AD 的请求中发送。如果用户使用 Internet Explorer 或 Edge,并且发送静默登录请求的 Web 应用与 Azure AD 终结点 (login.microsoftonline.com) 位于不同的 IE 安全区域,则可能会发生这种情况。
尝试断开连接并重新登录但没有成功
我想不通的尴尬之处在于它经常有效,然后有时会引发此错误,使页面保持重新加载循环。
如果我删除 AAD 调用,它会按预期工作。
这是因为我必须管理 2 个令牌,一个使用 API,一个使用 AAD GraphAPI?
如果是,我该如何处理?
非常感谢任何帮助
根据您的描述,您似乎遇到了随机死循环问题。有多种原因可能会引发此问题。
首先您可以检查您是否使用ui-router
,如果是,请检查您是否设置了根页面“/”的阶段定义。将此添加到您的状态提供商路由:
$stateProvider.state("/", {
url: "/",
templateUrl: "<could be home page or default page>",
requireADLogin: true,
});
此外,可能还有一些其他原因会导致此问题,例如创建嵌套 iframe、哈希重置。您可以参考https://github.com/AzureAD/azure-activedirectory-library-for-js/wiki/FAQs#q2-my-app-gets-into-an-infinite-loop-sometimes-leading-to-digest-iterations-error了解更多信息。
此外,您可以将下面的代码添加到app.js
以打开日志记录。根据您希望如何重定向日志来实现日志方法。
Logging = {
level: 3,
log: function (message) {
console.log(message);
}
};
此外,您还可以利用 Chrome 开发人员工具:
在 seesion 存储中查看包括错误描述在内的所有信息
我想我已经找到问题了;
在 google chrome 中,在 stress-test 中,登录后立即将 "Save the password" 浏览器 pop-up 设置为 "Never" 当浏览器询问我时;
在金丝雀和其他浏览器中,我设置 "Save" 或简单地忽略,问题从未出现。
似乎问题在清除 "never saved" 密码列表后得到解决。
复选框"Use Smart Lock for Passwords to remember passwords for apps and sites"或"Offer to save your web passwords"是无关紧要的,测试选中状态和non-checked。
谢谢!
有时我在从 Angular.
调用 Azure Active Directory Graph API 时收到错误 AADSTS50058我的设置:
- adal-angular1.0.13
- angular v1.5.8
- google chrome 'Block 3rd party cookies' 上没有标记
- 尝试启用 KMSI 标志
- Chrome(最新) 上没有阻止 cookie 的扩展
- 更新 : 路由包 "angular-route"
这是代码:
var my_endpoints = {
'https ://graph.windows.net/': 'https ://graph.windows.net/'
};
adalProvider.init({
instance: 'https ://login.microsoftonline.com/',
tenant: "common",
clientId: '[my-client-ID-here]',
extraQueryParameter: 'nux=1',
cacheLocation: 'sessionStorage',
endpoints: my_endpoints
}, $httpProvider);
n.b.: https 链接没有 space, 我设置这个是因为 Whosebug.
这是我无法解决的错误: 错误 AADSTS50058:发送了静默登录请求,但没有用户登录。用于表示用户会话的 cookie 未在发送到 Azure AD 的请求中发送。如果用户使用 Internet Explorer 或 Edge,并且发送静默登录请求的 Web 应用与 Azure AD 终结点 (login.microsoftonline.com) 位于不同的 IE 安全区域,则可能会发生这种情况。
尝试断开连接并重新登录但没有成功
我想不通的尴尬之处在于它经常有效,然后有时会引发此错误,使页面保持重新加载循环。 如果我删除 AAD 调用,它会按预期工作。
这是因为我必须管理 2 个令牌,一个使用 API,一个使用 AAD GraphAPI?
如果是,我该如何处理?
非常感谢任何帮助
根据您的描述,您似乎遇到了随机死循环问题。有多种原因可能会引发此问题。
首先您可以检查您是否使用ui-router
,如果是,请检查您是否设置了根页面“/”的阶段定义。将此添加到您的状态提供商路由:
$stateProvider.state("/", {
url: "/",
templateUrl: "<could be home page or default page>",
requireADLogin: true,
});
此外,可能还有一些其他原因会导致此问题,例如创建嵌套 iframe、哈希重置。您可以参考https://github.com/AzureAD/azure-activedirectory-library-for-js/wiki/FAQs#q2-my-app-gets-into-an-infinite-loop-sometimes-leading-to-digest-iterations-error了解更多信息。
此外,您可以将下面的代码添加到app.js
以打开日志记录。根据您希望如何重定向日志来实现日志方法。
Logging = {
level: 3,
log: function (message) {
console.log(message);
}
};
此外,您还可以利用 Chrome 开发人员工具:
在 seesion 存储中查看包括错误描述在内的所有信息我想我已经找到问题了; 在 google chrome 中,在 stress-test 中,登录后立即将 "Save the password" 浏览器 pop-up 设置为 "Never" 当浏览器询问我时; 在金丝雀和其他浏览器中,我设置 "Save" 或简单地忽略,问题从未出现。
似乎问题在清除 "never saved" 密码列表后得到解决。
复选框"Use Smart Lock for Passwords to remember passwords for apps and sites"或"Offer to save your web passwords"是无关紧要的,测试选中状态和non-checked。
谢谢!