当我们实现客户端凭证grant - Protecting an API using Client Credentials时,在客户端需要生成新的访问令牌之前,访问令牌可以使用多长时间(例如,过期日期是多少)?
发布于 2018-01-08 20:10:45
创建客户端时,可以定义访问令牌的生存期
var myClient = new Client
{
ClientId = "testClient",
AllowedGrantTypes = GrantTypes.ClientCredentials,
ClientSecrets =
{
new Secret("secret".Sha256())
},
AllowedScopes = { "api1" },
AccessTokenLifetime=3600
};如果您不提供AccessTokenLifetime,那么它将默认为3600,即一小时。这意味着它将在创建后一小时内过期
发布于 2018-01-09 12:36:05
https://stackoverflow.com/questions/48144842
复制相似问题