Class UpdateTotp
- java.lang.Object
-
- org.keycloak.authentication.requiredactions.UpdateTotp
-
- All Implemented Interfaces:
CredentialRegistrator,RequiredActionFactory,RequiredActionProvider,Provider,ProviderFactory<RequiredActionProvider>
public class UpdateTotp extends Object implements RequiredActionProvider, RequiredActionFactory, CredentialRegistrator
- Version:
- $Revision: 1 $
- Author:
- Bill Burke
-
-
Constructor Summary
Constructors Constructor Description UpdateTotp()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()This is called when the server shuts down.RequiredActionProvidercreate(KeycloakSession session)voidevaluateTriggers(RequiredActionContext context)Called every time a user authenticates.StringgetDisplayText()Display text used in admin console to reference this required actionStringgetId()voidinit(Config.Scope config)Only called once when the factory is first created.InitiatedActionSupportinitiatedActionSupport()Determines what type of support is provided for application-initiated actions.booleanisOneTimeAction()Flag indicating whether the execution of the required action by the same circumstances (e.g.voidpostInit(KeycloakSessionFactory factory)Called after all provider factories have been initializedvoidprocessAction(RequiredActionContext context)Called when a required action has form input you want to process.voidrequiredActionChallenge(RequiredActionContext context)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.protected booleanvalidateOTPCredential(RequiredActionContext context, String token, OTPCredentialModel credentialModel, OTPPolicy policy)-
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.RequiredActionProvider
getMaxAuthAge, initiatedActionCanceled
-
-
-
-
Method Detail
-
initiatedActionSupport
public InitiatedActionSupport initiatedActionSupport()
Description copied from interface:RequiredActionProviderDetermines what type of support is provided for application-initiated actions.- Specified by:
initiatedActionSupportin interfaceRequiredActionProvider- Returns:
- InititatedActionsSupport
-
evaluateTriggers
public void evaluateTriggers(RequiredActionContext context)
Description copied from interface:RequiredActionProviderCalled 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:
evaluateTriggersin interfaceRequiredActionProvider
-
requiredActionChallenge
public void requiredActionChallenge(RequiredActionContext context)
Description copied from interface:RequiredActionProviderIf 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:
requiredActionChallengein interfaceRequiredActionProvider
-
processAction
public void processAction(RequiredActionContext context)
Description copied from interface:RequiredActionProviderCalled when a required action has form input you want to process.- Specified by:
processActionin interfaceRequiredActionProvider
-
validateOTPCredential
protected boolean validateOTPCredential(RequiredActionContext context, String token, OTPCredentialModel credentialModel, OTPPolicy policy)
-
close
public void close()
Description copied from interface:ProviderFactoryThis is called when the server shuts down.- Specified by:
closein interfaceProvider- Specified by:
closein interfaceProviderFactory<RequiredActionProvider>
-
create
public RequiredActionProvider create(KeycloakSession session)
- Specified by:
createin interfaceProviderFactory<RequiredActionProvider>
-
init
public void init(Config.Scope config)
Description copied from interface:ProviderFactoryOnly called once when the factory is first created. This config is pulled from keycloak_server.json- Specified by:
initin interfaceProviderFactory<RequiredActionProvider>
-
postInit
public void postInit(KeycloakSessionFactory factory)
Description copied from interface:ProviderFactoryCalled after all provider factories have been initialized- Specified by:
postInitin interfaceProviderFactory<RequiredActionProvider>
-
getDisplayText
public String getDisplayText()
Description copied from interface:RequiredActionFactoryDisplay text used in admin console to reference this required action- Specified by:
getDisplayTextin interfaceRequiredActionFactory- Returns:
-
getId
public String getId()
- Specified by:
getIdin interfaceProviderFactory<RequiredActionProvider>
-
isOneTimeAction
public boolean isOneTimeAction()
Description copied from interface:RequiredActionFactoryFlag indicating whether the execution of the required action by the same circumstances (e.g. by one and the same action token) should only be permitted once.- Specified by:
isOneTimeActionin interfaceRequiredActionFactory- Returns:
-
-