我使用hello.js在Microsoft Graph中签。AADSTS50058:一个无声的登录请求被发送,但没有用户登录,
首先我通过
hello.init({
msft: {
id: myAppId,
oauth: {
version: 2,
auth: 'https://login.microsoftonline.com/common/oauth2/v2.0/authorize'
},
scope_delim: ' ',
form: false
},
},
{ redirect_uri: window.location.href }
);
然后初始化我在我的应用程序签名的成功
hello('msft').login({ scope: 'User.Read' })
这是hello.js在登录后保存在localStorage的。
{
"msft": {
"access_token":"aLongToken",
"token_type":"Bearer",
"expires_in":3599,
"scope":"basic,User.Read",
"state":"",
"session_state":"f034f785-f8d0-4cec-aab4-88559c9d93dd",
"client_id":"a91e6907-2b6e-4793-848d-633e960e809d",
"network":"msft",
"display":"popup",
"redirect_uri":"http://localhost:3006/login",
"expires":1501800737.361
}
}
但是,当我尝试刷新access_token时
hello('msft').login({
display: 'none',
response_type: 'id_token token',
response_mode: 'fragment',
nonce: 'my-app',
prompt: 'none',
scope: 'User.Read',
login_hint: '[email protected]',
domain_hint: 'organizations'
})
我得到了错误
AADSTS50058:一个无声的登录请求被发送,但没有用户登录, 用来表示用户会话的cookies在 请求没有被发送到Azure AD。这可以,如果用户使用因特网 Explorer或边缘发生,该网络应用程序发送所述静默登录请求 是在不同的IE安全区域比天青AD端点 (login.microsoftonline.com)。
我使用Chrome。
在GitHub实测值this issue。但仍然没有弄清楚如何正确刷新。
UPDATE:
禁用后在https://apps.dev.microsoft.com允许隐流,现在我甚至没有登录所以这不是正确的解决方案。 hello.js在localStorage的保存此错误:
{
"msft": {
"error": {
"code":"unsupported_response_type",
"message":"AADSTS70005: response_type 'token' is not enabled for the application\r\nTrace ID: 1dc20dd0-cab3-41b5-9849-2a7e35d60700\r\nCorrelation ID: caacce8f-6763-405d-a840-70c24d5306d4\r\nTimestamp: 2017-08-04 21:56:42Z"
},
"error_description":"AADSTS70005: response_type 'token' is not enabled for the application\r\nTrace ID: 1dc20dd0-cab3-41b5-9849-2a7e35d60700\r\nCorrelation ID: caacce8f-6763-405d-a840-70c24d5306d4\r\nTimestamp: 2017-08-04 21:56:42Z",
"state":"",
"client_id":"a91e6907-2b6e-4793-848d-633e960e809d",
"network":"msft",
"display":"popup",
"redirect_uri":"http://localhost:3006/login",
"scope":"basic,User.Read"
}
}
你知道为什么以及如何知道哪一个是使用?假设您的用户对象包含两个电子邮件地址 - 哪个属性是正确的? –
@mikenelson它是'userPrincipalName' –