public class TokenProvider extends Object
| 构造器和说明 |
|---|
TokenProvider(String secretKey,
long tokenValidityInMilliseconds,
long tokenValidityInMillisecondsForRememberMe)
构造函数2
|
| 限定符和类型 | 方法和说明 |
|---|---|
String |
createToken(org.springframework.security.core.Authentication authentication,
boolean rememberMe)
创建Token
|
org.springframework.security.core.Authentication |
getAuthentication(String token)
获取认证信息
|
boolean |
validateToken(String authToken) |
public TokenProvider(String secretKey, long tokenValidityInMilliseconds, long tokenValidityInMillisecondsForRememberMe)
secretKey - tokenValidityInMilliseconds - tokenValidityInMillisecondsForRememberMe - public String createToken(org.springframework.security.core.Authentication authentication, boolean rememberMe)
authentication - 认证信息rememberMe - 是否记住我public org.springframework.security.core.Authentication getAuthentication(String token)
token - tokenpublic boolean validateToken(String authToken)
authToken - Copyright © 2019. All rights reserved.