KEYCLOAK-5257 Clarify usage of TokenVerifier

This commit is contained in:
Hynek Mlnarik authored and Hynek Mlnařík committed 2018-08-01 13:38:31 +02:00
1 parent 29da7d3d90
commit f57cc3a9c0
2 files changed
+6 -3

No files matched your search

@@ -167,12 +167,15 @@ public class TokenVerifier<T extends JsonWebToken> {
}
/**
* Creates an instance of {@code TokenVerifier} from the given string on a JWT of the given class.
* Creates an instance of {@code TokenVerifier} for the given token.
* The token verifier has no checks defined. Note that the checks are only tested when
* {@link #verify()} method is invoked.
* <p>
* <b>NOTE:</b> The returned token verifier cannot verify token signature since
* that is not part of the {@link JsonWebToken} object.
* @return
*/
public static <T extends JsonWebToken> TokenVerifier<T> create(T token) {
public static <T extends JsonWebToken> TokenVerifier<T> createWithoutSignature(T token) {
return new TokenVerifier(token);
}
@@ -544,7 +544,7 @@ public class LoginActionsService {
session.getContext().setClient(authSession.getClient());
TokenVerifier.create(token)
TokenVerifier.createWithoutSignature(token)
.withChecks(handler.getVerifiers(tokenContext))
.verify();