是否可以使用相同的客户端凭据拥有多个有效的访问令牌? [英] Is it possible to have multiple valid access tokens with the same client credentials?

查看:26
本文介绍了是否可以使用相同的客户端凭据拥有多个有效的访问令牌?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用 OAuth2 身份验证的 API.客户使用 WSO2 订阅了我的 API.我们不使用刷新令牌.所有访问令牌都会在 1 小时后过期.

I have an API set with OAuth2 authentication. A client has subscribe to my API using WSO2. We don't use refresh tokens. All access tokens expire in 1 hour.

如果我的客户端使用相同的客户端凭据请求 2 个访问令牌会怎样?第一个令牌会被撤销还是两个令牌都会存活 1 小时?

What happens if my client requests 2 access tokens with the same client credentials? Will the first token be revoked or will both tokens live 1 hour?

推荐答案

根据 WSO2 文档,您不能拥有多个访问令牌.您可以做的是将令牌过期时间更改为超过一小时.

According to WSO2 docs, you can't have more than one access token. What you can do instead is changing the token expiration time to longer than one hour.

在 WSO2 API-M 中,以下组合的访问令牌必须是唯一的 - CONSUMER_KEY、AUTHZ_USER、USER_TYPE、TOKEN_STATE、TOKEN_STATE_ID 和 TOKEN_SCOPE.后面提到的约束在 IDN_OAUTH2_ACCESS_TOKEN 表中定义.因此,上述任何一种组合都不能有多个访问令牌.

In WSO2 API-M the access token must be unique for the following combinations - CONSUMER_KEY, AUTHZ_USER, USER_TYPE, TOKEN_STATE, TOKEN_STATE_ID and TOKEN_SCOPE. The latter mentioned constraint is defined in the IDN_OAUTH2_ACCESS_TOKEN table. Therefore, it is not possible to have more than one Access Token for any of the above combinations.

这篇关于是否可以使用相同的客户端凭据拥有多个有效的访问令牌?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆