我正在开发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)。 –