Class ConsoleOTPFormAuthenticator
- java.lang.Object
-
- org.keycloak.authentication.AbstractFormAuthenticator
-
- org.keycloak.authentication.authenticators.browser.AbstractUsernameFormAuthenticator
-
- org.keycloak.authentication.authenticators.browser.OTPFormAuthenticator
-
- org.keycloak.authentication.authenticators.console.ConsoleOTPFormAuthenticator
-
- All Implemented Interfaces:
Authenticator
,CredentialValidator<OTPCredentialProvider>
,Provider
public class ConsoleOTPFormAuthenticator extends OTPFormAuthenticator implements Authenticator
- Version:
- $Revision: 1 $
- Author:
- Bill Burke
-
-
Field Summary
Fields Modifier and Type Field Description static ConsoleOTPFormAuthenticator
SINGLETON
-
Fields inherited from class org.keycloak.authentication.authenticators.browser.OTPFormAuthenticator
SELECTED_OTP_CREDENTIAL_ID, UNNAMED
-
Fields inherited from class org.keycloak.authentication.authenticators.browser.AbstractUsernameFormAuthenticator
ATTEMPTED_USERNAME, REGISTRATION_FORM_ACTION, USER_SET_BEFORE_USERNAME_PASSWORD_AUTH
-
-
Constructor Summary
Constructors Constructor Description ConsoleOTPFormAuthenticator()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
action(AuthenticationFlowContext context)
Called from a form action invocation.void
authenticate(AuthenticationFlowContext context)
Initial call for the authenticator.protected ConsoleDisplayMode
challenge(AuthenticationFlowContext context)
protected javax.ws.rs.core.Response
challenge(AuthenticationFlowContext context, String msg)
void
close()
static URI
getCallbackUrl(AuthenticationFlowContext context)
-
Methods inherited from class org.keycloak.authentication.authenticators.browser.OTPFormAuthenticator
configuredFor, createLoginForm, disabledByBruteForceError, disabledByBruteForceFieldError, getCredentialProvider, getRequiredActions, requiresUser, setRequiredActions, validateOTP
-
Methods inherited from class org.keycloak.authentication.authenticators.browser.AbstractUsernameFormAuthenticator
challenge, dummyHash, enabledUser, getDefaultChallengeMessage, isDisabledByBruteForce, isUserAlreadySetBeforeUsernamePasswordAuth, runDefaultDummyHash, setDuplicateUserChallenge, testInvalidUser, validatePassword, validateUser, validateUserAndPassword
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.keycloak.authentication.Authenticator
areRequiredActionsEnabled, configuredFor, getRequiredActions, requiresUser, setRequiredActions
-
Methods inherited from interface org.keycloak.authentication.CredentialValidator
getCredentials, getType
-
-
-
-
Field Detail
-
SINGLETON
public static final ConsoleOTPFormAuthenticator SINGLETON
-
-
Method Detail
-
getCallbackUrl
public static URI getCallbackUrl(AuthenticationFlowContext context)
-
challenge
protected ConsoleDisplayMode challenge(AuthenticationFlowContext context)
-
action
public void action(AuthenticationFlowContext context)
Description copied from interface:Authenticator
Called from a form action invocation.- Specified by:
action
in interfaceAuthenticator
- Overrides:
action
in classOTPFormAuthenticator
-
authenticate
public void authenticate(AuthenticationFlowContext context)
Description copied from interface:Authenticator
Initial call for the authenticator. This method should check the current HTTP request to determine if the request satifies the Authenticator's requirements. If it doesn't, it should send back a challenge response by calling the AuthenticationFlowContext.challenge(Response). If this challenge is a authentication, the action URL of the form must point to /realms/{realm}/login-actions/authenticate?code={session-code}&execution={executionId} or /realms/{realm}/login-actions/registration?code={session-code}&execution={executionId} {session-code} pertains to the code generated from AuthenticationFlowContext.generateAccessCode(). The {executionId} pertains to the AuthenticationExecutionModel.getId() value obtained from AuthenticationFlowContext.getExecution(). The action URL will invoke the action() method described below.- Specified by:
authenticate
in interfaceAuthenticator
- Overrides:
authenticate
in classOTPFormAuthenticator
-
challenge
protected javax.ws.rs.core.Response challenge(AuthenticationFlowContext context, String msg)
- Overrides:
challenge
in classAbstractUsernameFormAuthenticator
-
close
public void close()
- Specified by:
close
in interfaceProvider
- Overrides:
close
in classOTPFormAuthenticator
-
-