Package org.keycloak.authentication
Interface AbstractAuthenticationFlowContext
- 
- All Known Subinterfaces:
- AuthenticationFlowContext,- ClientAuthenticationFlowContext
 - All Known Implementing Classes:
- AuthenticationProcessor.Result
 
 public interface AbstractAuthenticationFlowContext- Version:
- $Revision: 1 $
- Author:
- Bill Burke
 
- 
- 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description voidattempted()There was no failure or challenge.voidchallenge(javax.ws.rs.core.Response challenge)Sends a challenge response back to the HTTP client.voidfailure(AuthenticationFlowError error)Aborts the current flowvoidfailure(AuthenticationFlowError error, javax.ws.rs.core.Response response)Aborts the current flow.voidfailure(AuthenticationFlowError error, javax.ws.rs.core.Response response, String eventDetails, String userErrorMessage)Aborts the current flow.voidfailureChallenge(AuthenticationFlowError error, javax.ws.rs.core.Response challenge)Same behavior as forceChallenge(), but the error count in brute force attack detection will be incremented.voidforceChallenge(javax.ws.rs.core.Response challenge)Sends the challenge back to the HTTP client irregardless of the current executionr requirementStringgenerateAccessCode()Generates access code and updates clientsession timestamp Access codes must be included in form action callbacks as a query parameter.AuthenticatorConfigModelgetAuthenticatorConfig()Get any configuration associated with the current executionAuthenticationExecutionModel.RequirementgetCategoryRequirementFromCurrentFlow(String authenticatorCategory)ClientConnectiongetConnection()Information about the IP address from the connecting HTTP client.AuthenticationFlowErrorgetError()Get the error condition of a failed execution.EventBuildergetEvent()Current event builder being usedStringgetEventDetails()Get details of the event that caused an errorAuthenticationExecutionModelgetExecution()The current execution in the flowFormMessagegetForwardedErrorMessage()This could be an error message forwarded from another authenticator that is restarting or continuing the flo.FormMessagegetForwardedInfoMessage()This could be an info message forwarded from another authenticator.FormMessagegetForwardedSuccessMessage()This could be an success message forwarded from another authenticator that is restarting or continuing the flow.HttpRequestgetHttpRequest()BruteForceProtectorgetProtector()RealmModelgetRealm()Current realmKeycloakSessiongetSession()Current sessionFlowStatusgetStatus()Get the current status of the current execution.javax.ws.rs.core.UriInfogetUriInfo()UriInfo of the current requestStringgetUserErrorMessage()A custom error message that can be displayed to the userEventBuildernewEvent()Create a refresh new EventBuilder to use within this contextvoidsetForwardedInfoMessage(String message, Object... parameters)voidsuccess()Mark the current execution as successful.
 
- 
- 
- 
Method Detail- 
getEventEventBuilder getEvent() Current event builder being used- Returns:
 
 - 
newEventEventBuilder newEvent() Create a refresh new EventBuilder to use within this context- Returns:
 
 - 
getExecutionAuthenticationExecutionModel getExecution() The current execution in the flow- Returns:
 
 - 
getRealmRealmModel getRealm() Current realm- Returns:
 
 - 
getConnectionClientConnection getConnection() Information about the IP address from the connecting HTTP client.- Returns:
 
 - 
getUriInfojavax.ws.rs.core.UriInfo getUriInfo() UriInfo of the current request- Returns:
 
 - 
getSessionKeycloakSession getSession() Current session- Returns:
 
 - 
getHttpRequestHttpRequest getHttpRequest() 
 - 
getProtectorBruteForceProtector getProtector() 
 - 
getAuthenticatorConfigAuthenticatorConfigModel getAuthenticatorConfig() Get any configuration associated with the current execution- Returns:
 
 - 
getForwardedErrorMessageFormMessage getForwardedErrorMessage() This could be an error message forwarded from another authenticator that is restarting or continuing the flo. For example the brokering API sends this when the broker failed authentication and we want to continue authentication locally. forwardedErrorMessage can then be displayed by whatever form is challenging.
 - 
getForwardedSuccessMessageFormMessage getForwardedSuccessMessage() This could be an success message forwarded from another authenticator that is restarting or continuing the flow. For example a reset password sends an email, then resets the flow with a success message. forwardedSuccessMessage can then be displayed by whatever form is challenging.
 - 
getForwardedInfoMessageFormMessage getForwardedInfoMessage() This could be an info message forwarded from another authenticator. This info message will be usually displayed only once on the first screen shown to the user during authentication. The authenticator forwarding the info message does not know which the screen would be. For example during user re-authentication, the user should see info message like "Please re-authenticate", but at the beginning of the authentication, it is not 100% clear which screen will be the first shown screen where this message should be displayed
 - 
setForwardedInfoMessagevoid setForwardedInfoMessage(String message, Object... parameters) - Parameters:
- message- to be forwarded
- parameters- parameters of the message if any
- See Also:
- getForwardedInfoMessage()
 
 - 
generateAccessCodeString generateAccessCode() Generates access code and updates clientsession timestamp Access codes must be included in form action callbacks as a query parameter.- Returns:
 
 - 
getCategoryRequirementFromCurrentFlowAuthenticationExecutionModel.Requirement getCategoryRequirementFromCurrentFlow(String authenticatorCategory) 
 - 
successvoid success() Mark the current execution as successful. The flow will then continue
 - 
failurevoid failure(AuthenticationFlowError error) Aborts the current flow- Parameters:
- error-
 
 - 
failurevoid failure(AuthenticationFlowError error, javax.ws.rs.core.Response response) Aborts the current flow.- Parameters:
- error-
- response- Response that will be sent back to HTTP client
 
 - 
failurevoid failure(AuthenticationFlowError error, javax.ws.rs.core.Response response, String eventDetails, String userErrorMessage) Aborts the current flow.- Parameters:
- error-
- response- Response that will be sent back to HTTP client
- eventDetails- Details about the error event
- userErrorMessage- A message describing the error to the user
 
 - 
challengevoid challenge(javax.ws.rs.core.Response challenge) Sends a challenge response back to the HTTP client. If the current execution requirement is optional, this response will not be sent. If the current execution requirement is alternative, then this challenge will be sent if no other alternative execution was successful.- Parameters:
- challenge-
 
 - 
forceChallengevoid forceChallenge(javax.ws.rs.core.Response challenge) Sends the challenge back to the HTTP client irregardless of the current executionr requirement- Parameters:
- challenge-
 
 - 
failureChallengevoid failureChallenge(AuthenticationFlowError error, javax.ws.rs.core.Response challenge) Same behavior as forceChallenge(), but the error count in brute force attack detection will be incremented. For example, if a user enters in a bad password, the user is directed to try again, but Keycloak will keep track of how many failures have happened.- Parameters:
- error-
- challenge-
 
 - 
attemptedvoid attempted() There was no failure or challenge. The authenticator was attempted, but not fulfilled. If the current execution requirement is alternative or optional, then this status is ignored by the flow.
 - 
getStatusFlowStatus getStatus() Get the current status of the current execution.- Returns:
- may return null if not set yet.
 
 - 
getErrorAuthenticationFlowError getError() Get the error condition of a failed execution.- Returns:
- may return null if there was no error
 
 - 
getEventDetailsString getEventDetails() Get details of the event that caused an error- Returns:
- may return null if not set
 
 - 
getUserErrorMessageString getUserErrorMessage() A custom error message that can be displayed to the user- Returns:
- Optional error message
 
 
- 
 
-