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 Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `attempted()` There was no failure or challenge.
    `void` | `challenge(javax.ws.rs.core.Response challenge)` Sends a challenge response back to the HTTP client.
    `void` | `failure(AuthenticationFlowError error)` Aborts the current flow
    `void` | `failure(AuthenticationFlowError error, javax.ws.rs.core.Response response)` Aborts the current flow.
    `void` | `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.
    `void` | `forceChallenge(javax.ws.rs.core.Response challenge)` Sends the challenge back to the HTTP client irregardless of the current executionr requirement
    `String` | `generateAccessCode()` Generates access code and updates clientsession timestamp Access codes must be included in form action callbacks as a query parameter.
    `AuthenticatorConfigModel` | `getAuthenticatorConfig()` Get any configuration associated with the current execution
    `AuthenticationExecutionModel.Requirement` | `getCategoryRequirementFromCurrentFlow(String authenticatorCategory)`
    `ClientConnection` | `getConnection()` Information about the IP address from the connecting HTTP client.
    `AuthenticationFlowError` | `getError()` Get the error condition of a failed execution.
    `EventBuilder` | `getEvent()` Current event builder being used
    `AuthenticationExecutionModel` | `getExecution()` The current execution in the flow
    `FormMessage` | `getForwardedErrorMessage()` This could be an error message forwarded from another authenticator that is restarting or continuing the flo.
    `FormMessage` | `getForwardedSuccessMessage()` This could be an success message forwarded from another authenticator that is restarting or continuing the flow.
    `org.jboss.resteasy.spi.HttpRequest` | `getHttpRequest()`
    `BruteForceProtector` | `getProtector()`
    `RealmModel` | `getRealm()` Current realm
    `KeycloakSession` | `getSession()` Current session
    `FlowStatus` | `getStatus()` Get the current status of the current execution.
    `javax.ws.rs.core.UriInfo` | `getUriInfo()` UriInfo of the current request
    `EventBuilder` | `newEvent()` Create a refresh new EventBuilder to use within this context
    `void` | `success()` Mark the current execution as successful.

- - ### Method Detail

    - #### getEvent

          EventBuilder getEvent()

      Current event builder being used
      Returns:

    - #### newEvent

          EventBuilder newEvent()

      Create a refresh new EventBuilder to use within this context
      Returns:

    - #### getExecution

          AuthenticationExecutionModel getExecution()

      The current execution in the flow
      Returns:

    - #### getRealm

          RealmModel getRealm()

      Current realm
      Returns:

    - #### getConnection

          ClientConnection getConnection()

      Information about the IP address from the connecting HTTP client.
      Returns:

    - #### getUriInfo

          javax.ws.rs.core.UriInfo getUriInfo()

      UriInfo of the current request
      Returns:

    - #### getSession

          KeycloakSession getSession()

      Current session
      Returns:

    - #### getHttpRequest

          org.jboss.resteasy.spi.HttpRequest getHttpRequest()

    - #### getProtector

          BruteForceProtector getProtector()

    - #### getAuthenticatorConfig

          AuthenticatorConfigModel getAuthenticatorConfig()

      Get any configuration associated with the current execution
      Returns:

    - #### getForwardedErrorMessage

          FormMessage 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.

    - #### getForwardedSuccessMessage

          FormMessage 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.

    - #### generateAccessCode

          String generateAccessCode()

      Generates access code and updates clientsession timestamp Access codes must be included in form action callbacks as a query parameter.
      Returns:

    - #### getCategoryRequirementFromCurrentFlow

          AuthenticationExecutionModel.Requirement getCategoryRequirementFromCurrentFlow(String authenticatorCategory)

    - #### success

          void success()

      Mark the current execution as successful. The flow will then continue

    - #### failure

          void failure(AuthenticationFlowError error)

      Aborts the current flow
      Parameters:
        `error` -

    - #### failure

          void 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

    - #### challenge

          void 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` -

    - #### forceChallenge

          void forceChallenge(javax.ws.rs.core.Response challenge)

      Sends the challenge back to the HTTP client irregardless of the current executionr requirement
      Parameters:
        `challenge` -

    - #### failureChallenge

          void 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` -

    - #### attempted

          void 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.

    - #### getStatus

          FlowStatus getStatus()

      Get the current status of the current execution.
      Returns:
        may return null if not set yet.

    - #### getError

          AuthenticationFlowError getError()

      Get the error condition of a failed execution.
      Returns:
        may return null if there was no error

Copyright © 2021 JBoss by Red Hat. All rights reserved.