org.keycloak.authentication

## Interface AuthenticationFlowContext

- All Superinterfaces:
    AbstractAuthenticationFlowContext
  All Known Implementing Classes:
    AuthenticationProcessor.Result

      public interface AuthenticationFlowContext
      extends AbstractAuthenticationFlowContext

  This interface encapsulates information about an execution in an AuthenticationFlow. It is also used to set the status of the execution being performed.
  Version:
    $Revision: 1 $
  Author:
    Bill Burke

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `attachUserSession(UserSessionModel userSession)`
    `void` | `cancelLogin()` End the flow and redirect browser based on protocol specific respones.
    `void` | `clearUser()` Clear the user from the flow.
    `void` | `fork()` Fork the current flow.
    `void` | `forkWithErrorMessage(FormMessage message)` Fork the current flow.
    `void` | `forkWithSuccessMessage(FormMessage message)` Fork the current flow.
    `LoginFormsProvider` | `form()` Create a Freemarker form builder that presets the user, action URI, and a generated access code
    `URI` | `getActionUrl()` Get the action URL for the required action.
    `URI` | `getActionUrl(String code)` Get the action URL for the required action.
    `ClientSessionModel` | `getClientSession()` ClientSessionModel attached to this flow
    `UserModel` | `getUser()` Current user attached to this flow.
    `void` | `resetFlow()` Reset the current flow to the beginning and restarts it.
    `void` | `setUser(UserModel user)` Attach a specific user to this flow.

    - ### Methods inherited from interface org.keycloak.authentication.AbstractAuthenticationFlowContext

      `attempted, challenge, failure, failure, failureChallenge, forceChallenge, generateAccessCode, getAuthenticatorConfig, getCategoryRequirementFromCurrentFlow, getConnection, getError, getEvent, getExecution, getForwardedErrorMessage, getForwardedSuccessMessage, getHttpRequest, getProtector, getRealm, getSession, getStatus, getUriInfo, newEvent, success`

- - ### Method Detail

    - #### getUser

          UserModel getUser()

      Current user attached to this flow. It can return null if no user has been identified yet
      Returns:

    - #### setUser

          void setUser(UserModel user)

      Attach a specific user to this flow.
      Parameters:
        `user` -

    - #### clearUser

          void clearUser()

      Clear the user from the flow.

    - #### attachUserSession

          void attachUserSession(UserSessionModel userSession)

    - #### getClientSession

          ClientSessionModel getClientSession()

      ClientSessionModel attached to this flow
      Returns:

    - #### form

          LoginFormsProvider form()

      Create a Freemarker form builder that presets the user, action URI, and a generated access code
      Returns:

    - #### getActionUrl

          URI getActionUrl(String code)

      Get the action URL for the required action.
      Parameters:
        `code` - client session access code
      Returns:

    - #### getActionUrl

          URI getActionUrl()

      Get the action URL for the required action. This auto-generates the access code.
      Returns:

    - #### cancelLogin

          void cancelLogin()

      End the flow and redirect browser based on protocol specific respones. This should only be executed in browser-based flows.

    - #### resetFlow

          void resetFlow()

      Reset the current flow to the beginning and restarts it.

    - #### fork

          void fork()

      Fork the current flow. The client session will be cloned and set to point at the realm's browser login flow. The Response will be the result of this fork. The previous flow will still be set at the current execution. This is used by reset password when it sends an email. It sends an email linking to the current flow and redirects the browser to a new browser login flow.

    - #### forkWithSuccessMessage

          void forkWithSuccessMessage(FormMessage message)

      Fork the current flow. The client session will be cloned and set to point at the realm's browser login flow. The Response will be the result of this fork. The previous flow will still be set at the current execution. This is used by reset password when it sends an email. It sends an email linking to the current flow and redirects the browser to a new browser login flow. This method will set up a success message that will be displayed in the first page of the new flow
      Parameters:
        `message` - Corresponds to raw text or a message property defined in a message bundle

    - #### forkWithErrorMessage

          void forkWithErrorMessage(FormMessage message)

      Fork the current flow. The client session will be cloned and set to point at the realm's browser login flow. The Response will be the result of this fork. The previous flow will still be set at the current execution. This is used by reset password when it sends an email. It sends an email linking to the current flow and redirects the browser to a new browser login flow. This method will set up an error message that will be displayed in the first page of the new flow
      Parameters:
        `message` - Corresponds to raw text or a message property defined in a message bundle

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