org.keycloak.authentication

## Interface RequiredActionContext

- All Known Implementing Classes:
    RequiredActionContextResult

      public interface RequiredActionContext

  Interface that encapsulates current information about the current requred action
  Version:
    $Revision: 1 $
  Author:
    Bill Burke

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Interface and Description
    --- | ---
    `static class` | `RequiredActionContext.Status`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `challenge(javax.ws.rs.core.Response response)` Send a challenge Response back to user
    `void` | `failure()` Abort the authentication with an error
    `LoginFormsProvider` | `form()` Create a Freemarker form builder that presets the user, action URI, and a generated access code
    `String` | `generateCode()` Generates access code and updates clientsession timestamp Access codes must be included in form action callbacks as a query parameter.
    `URI` | `getActionUrl()` Get the action URL for the required action.
    `URI` | `getActionUrl(String code)` Get the action URL for the required action.
    `javax.ws.rs.core.Response` | `getChallenge()` If challenge has been sent this returns the JAX-RS Response
    `ClientSessionModel` | `getClientSession()`
    `ClientConnection` | `getConnection()`
    `EventBuilder` | `getEvent()` Current event builder being used
    `org.jboss.resteasy.spi.HttpRequest` | `getHttpRequest()`
    `RealmModel` | `getRealm()`
    `KeycloakSession` | `getSession()`
    `RequiredActionContext.Status` | `getStatus()`
    `javax.ws.rs.core.UriInfo` | `getUriInfo()`
    `UserModel` | `getUser()` Current user
    `UserSessionModel` | `getUserSession()`
    `void` | `ignore()` Ignore this required action and go onto the next, or complete the flow.
    `void` | `success()` Mark this required action as successful.

- - ### Method Detail

    - #### getActionUrl

          URI getActionUrl(String code)

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

    - #### getActionUrl

          URI getActionUrl()

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

    - #### form

          LoginFormsProvider form()

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

    - #### getChallenge

          javax.ws.rs.core.Response getChallenge()

      If challenge has been sent this returns the JAX-RS Response
      Returns:

    - #### getEvent

          EventBuilder getEvent()

      Current event builder being used
      Returns:

    - #### getUser

          UserModel getUser()

      Current user
      Returns:

    - #### getRealm

          RealmModel getRealm()

    - #### getClientSession

          ClientSessionModel getClientSession()

    - #### getUserSession

          UserSessionModel getUserSession()

    - #### getConnection

          ClientConnection getConnection()

    - #### getUriInfo

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

    - #### getSession

          KeycloakSession getSession()

    - #### getHttpRequest

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

    - #### generateCode

          String generateCode()

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

    - #### getStatus

          RequiredActionContext.Status getStatus()

    - #### challenge

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

      Send a challenge Response back to user
      Parameters:
        `response` -

    - #### failure

          void failure()

      Abort the authentication with an error

    - #### success

          void success()

      Mark this required action as successful. The required action will be removed from the UserModel

    - #### ignore

          void ignore()

      Ignore this required action and go onto the next, or complete the flow.

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