public class TokenUtil extends Object
Modifier and Type | Field and Description |
---|---|
static String |
TOKEN_TYPE_BEARER |
static String |
TOKEN_TYPE_ID |
static String |
TOKEN_TYPE_KEYCLOAK_ID |
static String |
TOKEN_TYPE_OFFLINE |
static String |
TOKEN_TYPE_REFRESH |
Constructor and Description |
---|
TokenUtil() |
Modifier and Type | Method and Description |
---|---|
static String |
attachOIDCScope(String scopeParam) |
static RefreshToken |
getRefreshToken(byte[] decodedToken)
Return refresh token or offline token
|
static RefreshToken |
getRefreshToken(String refreshToken) |
static boolean |
hasPrompt(String promptParam,
String targetPrompt) |
static boolean |
hasScope(String scopeParam,
String targetScope) |
static boolean |
isOfflineToken(String refreshToken)
Return true if given refreshToken represents offline token
|
static boolean |
isOfflineTokenRequested(String scopeParam) |
static boolean |
isOIDCRequest(String scopeParam) |
static String |
jweDirectEncode(Key aesKey,
Key hmacKey,
JsonWebToken jwt) |
static <T extends JsonWebToken> |
jweDirectVerifyAndDecode(Key aesKey,
Key hmacKey,
String jweStr,
Class<T> expectedClass) |
static String |
jweKeyEncryptionEncode(Key encryptionKEK,
byte[] contentBytes,
String algAlgorithm,
String encAlgorithm,
String kid,
JWEAlgorithmProvider jweAlgorithmProvider,
JWEEncryptionProvider jweEncryptionProvider) |
static byte[] |
jweKeyEncryptionVerifyAndDecode(Key decryptionKEK,
String encodedContent) |
static byte[] |
jweKeyEncryptionVerifyAndDecode(Key decryptionKEK,
String encodedContent,
JWEAlgorithmProvider algorithmProvider,
JWEEncryptionProvider encryptionProvider) |
public static final String TOKEN_TYPE_BEARER
public static final String TOKEN_TYPE_KEYCLOAK_ID
public static final String TOKEN_TYPE_ID
public static final String TOKEN_TYPE_REFRESH
public static final String TOKEN_TYPE_OFFLINE
public static boolean isOIDCRequest(String scopeParam)
public static boolean isOfflineTokenRequested(String scopeParam)
public static RefreshToken getRefreshToken(byte[] decodedToken) throws JWSInputException
decodedToken
- JWSInputException
public static RefreshToken getRefreshToken(String refreshToken) throws JWSInputException
JWSInputException
public static boolean isOfflineToken(String refreshToken) throws JWSInputException
refreshToken
- JWSInputException
public static String jweDirectEncode(Key aesKey, Key hmacKey, JsonWebToken jwt) throws JWEException
JWEException
public static <T extends JsonWebToken> T jweDirectVerifyAndDecode(Key aesKey, Key hmacKey, String jweStr, Class<T> expectedClass) throws JWEException
JWEException
public static String jweKeyEncryptionEncode(Key encryptionKEK, byte[] contentBytes, String algAlgorithm, String encAlgorithm, String kid, JWEAlgorithmProvider jweAlgorithmProvider, JWEEncryptionProvider jweEncryptionProvider) throws JWEException
JWEException
public static byte[] jweKeyEncryptionVerifyAndDecode(Key decryptionKEK, String encodedContent) throws JWEException
JWEException
public static byte[] jweKeyEncryptionVerifyAndDecode(Key decryptionKEK, String encodedContent, JWEAlgorithmProvider algorithmProvider, JWEEncryptionProvider encryptionProvider) throws JWEException
JWEException
Copyright © 2020 JBoss by Red Hat. All rights reserved.