我正在開發mobile app
使用azure-mobile-apps科羅拉多客戶端。我跟着這個https://cgillum.tech/2016/08/10/app-service-auth-and-azure-ad-b2c-part-2/獲得刷新令牌。使用azure-mobile-apps科爾多瓦客戶端刷新令牌和註銷
我在標頭中發送id_token。
var token = window.localStorage.getItem("token");
var appUrl = https://Mobile****.azurewebsites.net;
var url = appUrl + "/.auth/refresh";
$http.get(url, {
headers: {
'X-ZUMO-AUTH': token
}
})
.then(function(response) {
console.log(response);
});
響應:401未經授權。 IDX10500:簽名驗證失敗。 無法解析SecurityKeyIdentifier ...
我比較了資源管理器和Tenant - > Application - > Keys中的密鑰。
兩者都是相同的。 我也想問一下關於註銷的問題,我們可以在這個端點/.auth/logout
上發送同樣的內容。
嗨@devangi,任何更新? –
嗨,對不起,請延遲。是的,我想問一下這些令牌(mobileServiceAuthenticationToken,id_token&refresh_token)?過期時間,id_token&refresh_token可通過/.auth/me端點獲得。 我的觀察是,即使您在1小時內分享任何沒有使用mobileServiceAuthenticationToken(使用/.auth/refresh),但過期時間將會相同(在/.auth/me)。 如果您使用舊令牌調用/.auth/refresh,一小時後,它會給內部服務器提供500個錯誤。那麼什麼是mobileServiceAuthentication令牌的生命週期,id_token&refresh_token? – devangi
關於如何保持用戶永久登錄,您可以參考[此線程](http://stackoverflow.com/questions/41310757/mobileservices-web-js-unauthorized-api-call)。 –