我使用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' –