为什么identityserver3没有返回刷新令牌
本文关键字:刷新 令牌 返回 identityserver3 为什么 | 更新日期: 2023-09-27 18:15:06
我的客户端使用OAuth2的隐式流。登录成功后,identityserver3返回访问令牌、过期、作用域等。但是它没有返回刷新令牌。我已经在请求url,客户端和identityServerServiceFactory的AllowedScopes中设置了offline_access范围,它不起作用。但是,如果我更改为授权代码流,identityserver3将返回刷新令牌。
我的代码如下:$("#btn").click(function () {
var authorizationUrl = 'http://localhost:44300/core/connect/authorize';
var client_id = 'MyMobileApp';
var redirect_uri = 'http://localhost:44300/JsImplicitFlowDemo.html';
var response_type = "token";
var scope = "offline_access";
var state = Date.now() + "" + Math.random();
localStorage["state"] = state;
var url = authorizationUrl + "?" +
"client_id=" + encodeURI(client_id) + "&" +
"redirect_uri=" + encodeURI(redirect_uri) + "&" +
"response_type=" + encodeURI(response_type) + "&" +
"scope=" + encodeURI(scope) + "&" +
"state=" + encodeURI(state);
window.location = url;
});
你能帮我一下吗,谢谢!
我刚刚读了OAuth2的隐式流程规范。隐式授权类型用于获取访问令牌(它不支持发布刷新令牌)