Class TokenUtils
- java.lang.Object
- 
- org.keycloak.authentication.actiontoken.TokenUtils
 
- 
 public class TokenUtils extends Object - Author:
- hmlnarik
 
- 
- 
Constructor SummaryConstructors Constructor Description TokenUtils()
 - 
Method SummaryAll Methods Static Methods Concrete Methods Modifier and Type Method Description static TokenVerifier.Predicate<JsonWebToken>checkThat(BooleanSupplier function, String errorEvent, String errorMessage)Returns a predicate for use inTokenVerifierusing the given boolean-returning function.static <T extends JsonWebToken>
 TokenVerifier.Predicate<T>checkThat(Predicate<T> function, String errorEvent, String errorMessage)Returns a predicate for use inTokenVerifierusing the given boolean-returning function.static <T extends JsonWebToken>
 TokenVerifier.Predicate<T>onlyIf(Predicate<T> condition, TokenVerifier.Predicate<T> predicate)Returns a predicate that is applied only if the givenconditionevaluates to .static <T extends JsonWebToken>
 TokenVerifier.Predicate<? super T>[]predicates(TokenVerifier.Predicate<? super T>... predicate)
 
- 
- 
- 
Method Detail- 
checkThatpublic static TokenVerifier.Predicate<JsonWebToken> checkThat(BooleanSupplier function, String errorEvent, String errorMessage) Returns a predicate for use inTokenVerifierusing the given boolean-returning function. When the function returnfalse, this predicate throws aExplainedTokenVerificationExceptionwithmessageanderrorEventset fromerrorMessageanderrorEvent, .- Parameters:
- function-
- errorEvent-
- errorMessage-
- Returns:
 
 - 
checkThatpublic static <T extends JsonWebToken> TokenVerifier.Predicate<T> checkThat(Predicate<T> function, String errorEvent, String errorMessage) Returns a predicate for use inTokenVerifierusing the given boolean-returning function. When the function returnfalse, this predicate throws aExplainedTokenVerificationExceptionwithmessageanderrorEventset fromerrorMessageanderrorEvent, .- Parameters:
- function-
- errorEvent-
- errorMessage-
- Returns:
 
 - 
onlyIfpublic static <T extends JsonWebToken> TokenVerifier.Predicate<T> onlyIf(Predicate<T> condition, TokenVerifier.Predicate<T> predicate) Returns a predicate that is applied only if the givenconditionevaluates to . In case it evaluates tofalse, the predicate passes.- Type Parameters:
- T-
- Parameters:
- condition- Condition guarding execution of the predicate
- predicate- Predicate that gets tested if the condition evaluates to- true
- Returns:
 
 - 
predicatespublic static <T extends JsonWebToken> TokenVerifier.Predicate<? super T>[] predicates(TokenVerifier.Predicate<? super T>... predicate) 
 
- 
 
-