Class UpdateEmail
java.lang.Object
org.keycloak.authentication.requiredactions.UpdateEmail
- All Implemented Interfaces:
RequiredActionFactory
,RequiredActionProvider
,EnvironmentDependentProviderFactory
,Provider
,ProviderFactory<RequiredActionProvider>
public class UpdateEmail
extends Object
implements RequiredActionProvider, RequiredActionFactory, EnvironmentDependentProviderFactory
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
This is called when the server shuts down.create
(KeycloakSession session) void
evaluateTriggers
(RequiredActionContext context) Called every time a user authenticates.Display text used in admin console to reference this required actiongetId()
void
init
(Config.Scope config) Only called once when the factory is first created.Determines what type of support is provided for application-initiated actions.boolean
isSupported
(Config.Scope config) Check if the provider is supported and should be available based on the provider configuration.void
postInit
(KeycloakSessionFactory factory) Called after all provider factories have been initializedvoid
processAction
(RequiredActionContext context) Called when a required action has form input you want to process.void
If the user has a required action set, this method will be the initial call to obtain what to display to the user's browser.static void
updateEmailNow
(EventBuilder event, UserModel user, UserProfile emailUpdateValidationResult) static UserProfile
validateEmailUpdate
(KeycloakSession session, UserModel user, String newEmail) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.keycloak.provider.ProviderFactory
getConfigMetadata, order
Methods inherited from interface org.keycloak.authentication.RequiredActionFactory
isConfigurable, isOneTimeAction, validateConfig
Methods inherited from interface org.keycloak.authentication.RequiredActionProvider
getMaxAuthAge, initiatedActionCanceled
-
Constructor Details
-
UpdateEmail
public UpdateEmail()
-
-
Method Details
-
initiatedActionSupport
Description copied from interface:RequiredActionProvider
Determines what type of support is provided for application-initiated actions.- Specified by:
initiatedActionSupport
in interfaceRequiredActionProvider
- Returns:
- InititatedActionsSupport
-
getDisplayText
Description copied from interface:RequiredActionFactory
Display text used in admin console to reference this required action- Specified by:
getDisplayText
in interfaceRequiredActionFactory
- Returns:
-
evaluateTriggers
Description copied from interface:RequiredActionProvider
Called every time a user authenticates. This checks to see if this required action should be triggered. The implementation of this method is responsible for setting the required action on the UserModel. For example, the UpdatePassword required actions checks the password policies to see if the password has expired.- Specified by:
evaluateTriggers
in interfaceRequiredActionProvider
-
requiredActionChallenge
Description copied from interface:RequiredActionProvider
If the user has a required action set, this method will be the initial call to obtain what to display to the user's browser. Return null if no action should be done.- Specified by:
requiredActionChallenge
in interfaceRequiredActionProvider
-
processAction
Description copied from interface:RequiredActionProvider
Called when a required action has form input you want to process.- Specified by:
processAction
in interfaceRequiredActionProvider
-
validateEmailUpdate
public static UserProfile validateEmailUpdate(KeycloakSession session, UserModel user, String newEmail) -
updateEmailNow
public static void updateEmailNow(EventBuilder event, UserModel user, UserProfile emailUpdateValidationResult) -
create
- Specified by:
create
in interfaceProviderFactory<RequiredActionProvider>
-
init
Description copied from interface:ProviderFactory
Only called once when the factory is first created. This config is pulled from keycloak_server.json- Specified by:
init
in interfaceProviderFactory<RequiredActionProvider>
-
postInit
Description copied from interface:ProviderFactory
Called after all provider factories have been initialized- Specified by:
postInit
in interfaceProviderFactory<RequiredActionProvider>
-
close
public void close()Description copied from interface:ProviderFactory
This is called when the server shuts down.- Specified by:
close
in interfaceProvider
- Specified by:
close
in interfaceProviderFactory<RequiredActionProvider>
-
getId
- Specified by:
getId
in interfaceProviderFactory<RequiredActionProvider>
-
isSupported
Description copied from interface:EnvironmentDependentProviderFactory
Check if the provider is supported and should be available based on the provider configuration.- Specified by:
isSupported
in interfaceEnvironmentDependentProviderFactory
- Parameters:
config
- the provider configuration- Returns:
true
if the provider is supported. Otherwise,false
.
-