org.keycloak.authentication

## Class RequiredActionContextResult

- java.lang.Object
- - org.keycloak.authentication.RequiredActionContextResult

- All Implemented Interfaces:
    RequiredActionContext

      public class RequiredActionContextResult
      extends Object
      implements RequiredActionContext

  Version:
    $Revision: 1 $
  Author:
    Bill Burke

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface org.keycloak.authentication.RequiredActionContext

      `RequiredActionContext.Status`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected javax.ws.rs.core.Response` | `challenge`
    `protected ClientSessionModel` | `clientSession`
    `protected EventBuilder` | `eventBuilder`
    `protected RequiredActionFactory` | `factory`
    `protected org.jboss.resteasy.spi.HttpRequest` | `httpRequest`
    `protected RealmModel` | `realm`
    `protected KeycloakSession` | `session`
    `protected RequiredActionContext.Status` | `status`
    `protected UserModel` | `user`
    `protected UserSessionModel` | `userSession`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `RequiredActionContextResult(UserSessionModel userSession, ClientSessionModel clientSession, RealmModel realm, EventBuilder eventBuilder, KeycloakSession session, org.jboss.resteasy.spi.HttpRequest httpRequest, UserModel user, RequiredActionFactory factory)`

  - ### Method Summary

    All Methods Instance Methods Concrete 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.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### userSession

          protected UserSessionModel userSession

    - #### clientSession

          protected ClientSessionModel clientSession

    - #### realm

          protected RealmModel realm

    - #### eventBuilder

          protected EventBuilder eventBuilder

    - #### session

          protected KeycloakSession session

    - #### status

          protected RequiredActionContext.Status status

    - #### challenge

          protected javax.ws.rs.core.Response challenge

    - #### httpRequest

          protected org.jboss.resteasy.spi.HttpRequest httpRequest

    - #### user

          protected UserModel user

    - #### factory

          protected RequiredActionFactory factory

  - ### Constructor Detail

    - #### RequiredActionContextResult

          public RequiredActionContextResult(UserSessionModel userSession,
                                             ClientSessionModel clientSession,
                                             RealmModel realm,
                                             EventBuilder eventBuilder,
                                             KeycloakSession session,
                                             org.jboss.resteasy.spi.HttpRequest httpRequest,
                                             UserModel user,
                                             RequiredActionFactory factory)

  - ### Method Detail

    - #### getEvent

          public EventBuilder getEvent()

      Description copied from interface: `RequiredActionContext`
      Current event builder being used
      Specified by:
        `getEvent` in interface `RequiredActionContext`
      Returns:

    - #### getUser

          public UserModel getUser()

      Description copied from interface: `RequiredActionContext`
      Current user
      Specified by:
        `getUser` in interface `RequiredActionContext`
      Returns:

    - #### getRealm

          public RealmModel getRealm()

      Specified by:
        `getRealm` in interface `RequiredActionContext`

    - #### getClientSession

          public ClientSessionModel getClientSession()

      Specified by:
        `getClientSession` in interface `RequiredActionContext`

    - #### getUserSession

          public UserSessionModel getUserSession()

      Specified by:
        `getUserSession` in interface `RequiredActionContext`

    - #### getConnection

          public ClientConnection getConnection()

      Specified by:
        `getConnection` in interface `RequiredActionContext`

    - #### getUriInfo

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

      Specified by:
        `getUriInfo` in interface `RequiredActionContext`

    - #### getSession

          public KeycloakSession getSession()

      Specified by:
        `getSession` in interface `RequiredActionContext`

    - #### getHttpRequest

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

      Specified by:
        `getHttpRequest` in interface `RequiredActionContext`

    - #### getStatus

          public RequiredActionContext.Status getStatus()

      Specified by:
        `getStatus` in interface `RequiredActionContext`

    - #### challenge

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

      Description copied from interface: `RequiredActionContext`
      Send a challenge Response back to user
      Specified by:
        `challenge` in interface `RequiredActionContext`

    - #### failure

          public void failure()

      Description copied from interface: `RequiredActionContext`
      Abort the authentication with an error
      Specified by:
        `failure` in interface `RequiredActionContext`

    - #### success

          public void success()

      Description copied from interface: `RequiredActionContext`
      Mark this required action as successful. The required action will be removed from the UserModel
      Specified by:
        `success` in interface `RequiredActionContext`

    - #### ignore

          public void ignore()

      Description copied from interface: `RequiredActionContext`
      Ignore this required action and go onto the next, or complete the flow.
      Specified by:
        `ignore` in interface `RequiredActionContext`

    - #### getActionUrl

          public URI getActionUrl(String code)

      Description copied from interface: `RequiredActionContext`
      Get the action URL for the required action.
      Specified by:
        `getActionUrl` in interface `RequiredActionContext`
      Parameters:
        `code` - client sessino access code
      Returns:

    - #### generateCode

          public String generateCode()

      Description copied from interface: `RequiredActionContext`
      Generates access code and updates clientsession timestamp Access codes must be included in form action callbacks as a query parameter.
      Specified by:
        `generateCode` in interface `RequiredActionContext`
      Returns:

    - #### getActionUrl

          public URI getActionUrl()

      Description copied from interface: `RequiredActionContext`
      Get the action URL for the required action. This auto-generates the access code.
      Specified by:
        `getActionUrl` in interface `RequiredActionContext`
      Returns:

    - #### form

          public LoginFormsProvider form()

      Description copied from interface: `RequiredActionContext`
      Create a Freemarker form builder that presets the user, action URI, and a generated access code
      Specified by:
        `form` in interface `RequiredActionContext`
      Returns:

    - #### getChallenge

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

      Description copied from interface: `RequiredActionContext`
      If challenge has been sent this returns the JAX-RS Response
      Specified by:
        `getChallenge` in interface `RequiredActionContext`
      Returns:

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