程序包 gateway.api
类 JwtContext
java.lang.Object
gateway.api.JwtContext
JWT上下文
- 作者:
- neeker
-
字段概要
字段 -
构造器概要
构造器构造器说明JwtContext(String appToken, int tokenLiveSconds, com.auth0.jwt.algorithms.Algorithm algorithm) -
方法概要
修饰符和类型方法说明static JwtContextstatic JwtContext创建JWT上下文创建JWT令牌获取应用凭据int获取令牌存活时间(秒)voidsetTokenLiveSconds(int tokenLiveSconds) 设置令牌存活时间(秒)
-
字段详细资料
-
appToken
-
tokenLiveSconds
private int tokenLiveSconds -
algorithm
private com.auth0.jwt.algorithms.Algorithm algorithm
-
-
构造器详细资料
-
JwtContext
JwtContext(String appToken, int tokenLiveSconds, com.auth0.jwt.algorithms.Algorithm algorithm)
-
-
方法详细资料
-
getAppToken
获取应用凭据- 返回:
-
getTokenLiveSconds
public int getTokenLiveSconds()获取令牌存活时间(秒)- 返回:
-
setTokenLiveSconds
public void setTokenLiveSconds(int tokenLiveSconds) 设置令牌存活时间(秒)- 参数:
tokenLiveSconds- 秒
-
createJwtToken
创建JWT令牌- 返回:
-
create
创建JWT上下文- 参数:
app_token- 应用凭据rsa_key- RSA私钥token_live_seconds- 令牌存活时间- 返回:
-
create
public static JwtContext create(String app_token, com.auth0.jwt.algorithms.Algorithm algorithm, int token_live_seconds)
-