Class IdpVerifyAccountLinkActionTokenHandler
java.lang.Object
org.keycloak.authentication.actiontoken.AbstractActionTokenHandler<IdpVerifyAccountLinkActionToken>
org.keycloak.authentication.actiontoken.idpverifyemail.IdpVerifyAccountLinkActionTokenHandler
- All Implemented Interfaces:
ActionTokenHandler<IdpVerifyAccountLinkActionToken>,ActionTokenHandlerFactory<IdpVerifyAccountLinkActionToken>,Provider,ProviderFactory<ActionTokenHandler<IdpVerifyAccountLinkActionToken>>
public class IdpVerifyAccountLinkActionTokenHandler
extends AbstractActionTokenHandler<IdpVerifyAccountLinkActionToken>
Action token handler for verification of e-mail address.
- Author:
- hmlnarik
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetVerifiers(ActionTokenContext<IdpVerifyAccountLinkActionToken> tokenContext) Returns an array of verifiers that are tested prior to handling the token.jakarta.ws.rs.core.ResponsehandleToken(IdpVerifyAccountLinkActionToken token, ActionTokenContext<IdpVerifyAccountLinkActionToken> tokenContext) Performs the action as per the token details.voidpostInit(KeycloakSessionFactory factory) Called after all provider factories have been initializedstatic booleanrunIfUserVerified(KeycloakSession session, UserModel user, IdentityProviderModel broker, String federatedUserId, Runnable runnable) Atomically consume the cross-browser account-link proof and runrunnableonly if this caller won the consume.Methods inherited from class org.keycloak.authentication.actiontoken.AbstractActionTokenHandler
canUseTokenRepeatedly, close, create, eventType, getAuthenticationSessionIdFromToken, getDefaultErrorMessage, getDefaultEventError, getId, getTokenClass, init, startFreshAuthenticationSession, verifyEmailMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.keycloak.authentication.actiontoken.ActionTokenHandler
preHandleTokenMethods inherited from interface org.keycloak.provider.ProviderFactory
dependsOn, getConfigMetadata, order
-
Constructor Details
-
IdpVerifyAccountLinkActionTokenHandler
public IdpVerifyAccountLinkActionTokenHandler()
-
-
Method Details
-
postInit
Description copied from interface:ProviderFactoryCalled after all provider factories have been initialized- Specified by:
postInitin interfaceProviderFactory<ActionTokenHandler<IdpVerifyAccountLinkActionToken>>- Overrides:
postInitin classAbstractActionTokenHandler<IdpVerifyAccountLinkActionToken>
-
getVerifiers
public TokenVerifier.Predicate<? super IdpVerifyAccountLinkActionToken>[] getVerifiers(ActionTokenContext<IdpVerifyAccountLinkActionToken> tokenContext) Description copied from interface:ActionTokenHandlerReturns an array of verifiers that are tested prior to handling the token. All verifiers have to pass successfully for token to be handled. The returned array must not benull.- Returns:
- Verifiers or an empty array. The returned array must not be
null.
-
handleToken
public jakarta.ws.rs.core.Response handleToken(IdpVerifyAccountLinkActionToken token, ActionTokenContext<IdpVerifyAccountLinkActionToken> tokenContext) Description copied from interface:ActionTokenHandlerPerforms the action as per the token details. This method is only called if all verifiers returned inActionTokenHandler.handleToken(T, org.keycloak.authentication.actiontoken.ActionTokenContext<T>)succeed.- Returns:
-
runIfUserVerified
public static boolean runIfUserVerified(KeycloakSession session, UserModel user, IdentityProviderModel broker, String federatedUserId, Runnable runnable) Atomically consume the cross-browser account-link proof and runrunnableonly if this caller won the consume. Returnsfalseif no proof was present (already consumed or never created).
-