【发布时间】:2018-07-07 22:14:13
【问题描述】:
我们正在使用 Identity Server4 来保护我们的 API。我们希望使用刷新令牌来获得对 API 的长期访问权限。根据文档(“http://docs.identityserver.io/en/release/index.html”),我们已将 AllowOfflineAccess 设置为 true,但仍然无法正常工作。 AccessTokenLifeTime 过期(3600 秒)后,令牌不起作用。这是客户端:
return new List<Client>
{
new Client
{
ClientId = "client",
// no interactive user, use the clientid/secret for authentication
AllowedGrantTypes = GrantTypes.ClientCredentials,
// secret for authentication
ClientSecrets =
{
new Secret("secret".Sha256())
},
// scopes that client has access to
AllowedScopes = { "api1" },
AccessTokenLifetime=3600,
AllowOfflineAccess=true
}
【问题讨论】:
标签: identityserver4