public class LoginActionsServiceChecks extends Object
Modifier and Type | Class and Description |
---|---|
static class |
LoginActionsServiceChecks.AuthenticationSessionUserIdMatchesOneFromToken
This check verifies that user ID (subject) from the token matches
the one from the authentication session.
|
static class |
LoginActionsServiceChecks.IsActionRequired
Verifies that if authentication session exists and any action is required according to it, then it is
the expected one.
|
static class |
LoginActionsServiceChecks.IsRedirectValid
Verifies whether the given redirect URL, when set, is valid for the given client.
|
Constructor and Description |
---|
LoginActionsServiceChecks() |
Modifier and Type | Method and Description |
---|---|
static void |
checkIsClientValid(KeycloakSession session,
ClientModel client)
Verifies whether the client denoted by client ID in token's
iss (issuedFor )
field both exists and is enabled. |
static <T extends JsonWebToken> |
checkIsClientValid(T token,
ActionTokenContext<T> context)
Verifies whether the client denoted by client ID in token's
iss (issuedFor )
field both exists and is enabled. |
static void |
checkIsUserValid(KeycloakSession session,
RealmModel realm,
String userId,
Consumer<UserModel> userSetter)
Verifies whether the user given by ID both exists in the current realm.
|
static <T extends JsonWebToken & ActionTokenKeyModel> |
checkIsUserValid(T token,
ActionTokenContext<T> context)
Verifies whether the user given by ID both exists in the current realm.
|
static <T extends JsonWebToken> |
checkNotLoggedInYet(ActionTokenContext<T> context,
AuthenticationSessionModel authSessionFromCookie,
String authSessionId)
Verifies that the authentication session has not yet been converted to user session, in other words
that the user has not yet completed authentication and logged in.
|
static <T extends JsonWebToken & ActionTokenKeyModel> |
checkTokenWasNotUsedYet(T token,
ActionTokenContext<T> context) |
static <T extends JsonWebToken> |
doesAuthenticationSessionFromCookieMatchOneFromToken(ActionTokenContext<T> context,
AuthenticationSessionModel authSessionFromCookie,
String authSessionCompoundIdFromToken)
This check verifies that current authentication session is consistent with the one specified in token.
|
public static <T extends JsonWebToken> void checkNotLoggedInYet(ActionTokenContext<T> context, AuthenticationSessionModel authSessionFromCookie, String authSessionId) throws VerificationException
VerificationException
public static void checkIsUserValid(KeycloakSession session, RealmModel realm, String userId, Consumer<UserModel> userSetter) throws VerificationException
VerificationException
public static <T extends JsonWebToken & ActionTokenKeyModel> void checkIsUserValid(T token, ActionTokenContext<T> context) throws VerificationException
VerificationException
public static void checkIsClientValid(KeycloakSession session, ClientModel client) throws VerificationException
iss
(issuedFor
)
field both exists and is enabled.VerificationException
public static <T extends JsonWebToken> void checkIsClientValid(T token, ActionTokenContext<T> context) throws VerificationException
iss
(issuedFor
)
field both exists and is enabled.VerificationException
public static <T extends JsonWebToken> boolean doesAuthenticationSessionFromCookieMatchOneFromToken(ActionTokenContext<T> context, AuthenticationSessionModel authSessionFromCookie, String authSessionCompoundIdFromToken) throws VerificationException
T
- VerificationException
public static <T extends JsonWebToken & ActionTokenKeyModel> void checkTokenWasNotUsedYet(T token, ActionTokenContext<T> context) throws VerificationException
VerificationException
Copyright © 2021 JBoss by Red Hat. All rights reserved.