【发布时间】:2018-06-17 02:38:22
【问题描述】:
当我们实施客户端凭据授权时 - Protecting an API using Client Credentials 在客户端需要生成新的访问令牌之前,访问令牌可使用多长时间(例如到期日期是什么)?
【问题讨论】:
-
我认为默认的过期时间是 3600 秒。
标签: .net-core identityserver4 openid-connect
当我们实施客户端凭据授权时 - Protecting an API using Client Credentials 在客户端需要生成新的访问令牌之前,访问令牌可使用多长时间(例如到期日期是什么)?
【问题讨论】:
标签: .net-core identityserver4 openid-connect
创建客户端时,您可以定义访问令牌的生命周期
var myClient = new Client
{
ClientId = "testClient",
AllowedGrantTypes = GrantTypes.ClientCredentials,
ClientSecrets =
{
new Secret("secret".Sha256())
},
AllowedScopes = { "api1" },
AccessTokenLifetime=3600
};
如果您不提供 AccessTokenLifetime,那么它将默认为 3600,即一小时。这意味着它将在创建后一小时过期
【讨论】:
【讨论】: