public class SecurityUtil extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
private static String |
CLIENT_ID |
private static AtomicReference<SecurityClientDetailsService> |
clientDetailsServiceRef |
private static AtomicReference<SecurityJwtInfo> |
securityJwtInfoRef |
| 构造器和说明 |
|---|
SecurityUtil() |
| 限定符和类型 | 方法和说明 |
|---|---|
private static SecurityClientDetails |
clientDetails(String clientId)
获取客户端信息。
|
static SecurityToken |
createJWT(Map<String,Object> user,
String audience,
String issuer,
String tokenType)
创建令牌。
|
static String[] |
extractAndDecodeHeader()
客户端信息解码。
|
private static SecurityClientDetailsService |
getClientDetailsService()
获取客户端服务类。
|
static String |
getClientIdFromHeader()
获取请求头中的客户端id。
|
static long |
getExpire()
获取过期时间(次日凌晨3点)。
|
private static SecurityJwtInfo |
getJwtInfo()
获取配置类。
|
private static boolean |
validateClient(SecurityClientDetails clientDetails,
String clientId,
String clientSecret)
校验Client。
|
private static AtomicReference<SecurityClientDetailsService> clientDetailsServiceRef
private static AtomicReference<SecurityJwtInfo> securityJwtInfoRef
private static SecurityClientDetailsService getClientDetailsService()
private static SecurityJwtInfo getJwtInfo()
public static SecurityToken createJWT(Map<String,Object> user, String audience, String issuer, String tokenType)
user - useraudience - audienceissuer - issuertokenType - tokenTypepublic static long getExpire()
public static String[] extractAndDecodeHeader()
public static String getClientIdFromHeader()
private static SecurityClientDetails clientDetails(String clientId)
clientId - 客户端idprivate static boolean validateClient(SecurityClientDetails clientDetails, String clientId, String clientSecret)
clientDetails - 客户端信息clientId - 客户端idclientSecret - 客户端密钥Copyright © 2022 Zodiac. All rights reserved.