org.keycloak.services.resources

## Class LoginActionsService

- java.lang.Object
- - org.keycloak.services.resources.LoginActionsService

-     public class LoginActionsService
      extends Object

  Author:
    Stian Thorgersen

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `AUTH_SESSION_ID`
    `static String` | `AUTHENTICATE_PATH`
    `static String` | `CANCEL_AIA`
    `static String` | `FIRST_BROKER_LOGIN_PATH`
    `static String` | `FORWARDED_ERROR_MESSAGE_NOTE`
    `protected javax.ws.rs.core.HttpHeaders` | `headers`
    `static String` | `POST_BROKER_LOGIN_PATH`
    `protected javax.ws.rs.ext.Providers` | `providers`
    `static String` | `REGISTRATION_PATH`
    `static String` | `REQUIRED_ACTION`
    `static String` | `RESET_CREDENTIALS_PATH`
    `static String` | `RESTART_PATH`
    `protected KeycloakSession` | `session`
    `static String` | `SESSION_CODE`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `LoginActionsService(RealmModel realm, EventBuilder event)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static javax.ws.rs.core.UriBuilder` | `actionTokenProcessor(javax.ws.rs.core.UriInfo uriInfo)`
    `javax.ws.rs.core.Response` | `authenticate(String authSessionId, String code, String execution, String clientId, String tabId)` protocol independent login page entry point
    `javax.ws.rs.core.Response` | `authenticateForm(String authSessionId, String code, String execution, String clientId, String tabId)` URL called after login page.
    `static javax.ws.rs.core.UriBuilder` | `authenticationFormProcessor(javax.ws.rs.core.UriInfo uriInfo)`
    `protected javax.ws.rs.core.Response` | `brokerLoginFlow(String authSessionId, String code, String execution, String clientId, String tabId, String flowPath)`
    `javax.ws.rs.core.Response` | `executeActionToken(String authSessionId, String key, String execution, String clientId, String tabId)` Handles a given token using the given token handler.
    `javax.ws.rs.core.Response` | `firstBrokerLoginGet(String authSessionId, String code, String execution, String clientId, String tabId)`
    `javax.ws.rs.core.Response` | `firstBrokerLoginPost(String authSessionId, String code, String execution, String clientId, String tabId)`
    `static javax.ws.rs.core.UriBuilder` | `firstBrokerLoginProcessor(javax.ws.rs.core.UriInfo uriInfo)`
    `protected URI` | `getLastExecutionUrl(String flowPath, String executionId, String clientId, String tabId)`
    `protected <T extends JsonWebToken & ActionTokenKeyModel> javax.ws.rs.core.Response` | `handleActionToken(String tokenString, String execution, String clientId, String tabId)`
    `static javax.ws.rs.core.UriBuilder` | `loginActionsBaseUrl(javax.ws.rs.core.UriBuilder baseUriBuilder)`
    `static javax.ws.rs.core.UriBuilder` | `loginActionsBaseUrl(javax.ws.rs.core.UriInfo uriInfo)`
    `javax.ws.rs.core.Response` | `postBrokerLoginGet(String authSessionId, String code, String execution, String clientId, String tabId)`
    `javax.ws.rs.core.Response` | `postBrokerLoginPost(String authSessionId, String code, String execution, String clientId, String tabId)`
    `static javax.ws.rs.core.UriBuilder` | `postBrokerLoginProcessor(javax.ws.rs.core.UriInfo uriInfo)`
    `protected javax.ws.rs.core.Response` | `processAuthentication(boolean action, String execution, AuthenticationSessionModel authSession, String errorMessage)`
    `javax.ws.rs.core.Response` | `processConsent()` OAuth grant page.
    `protected javax.ws.rs.core.Response` | `processFlow(boolean action, String execution, AuthenticationSessionModel authSession, String flowPath, AuthenticationFlowModel flow, String errorMessage, AuthenticationProcessor processor)`
    `protected void` | `processLocaleParam(AuthenticationSessionModel authSession)`
    `javax.ws.rs.core.Response` | `processRegister(String authSessionId, String code, String execution, String clientId, String tabId)` Registration
    `protected javax.ws.rs.core.Response` | `processRegistration(boolean action, String execution, AuthenticationSessionModel authSession, String errorMessage)`
    `protected javax.ws.rs.core.Response` | `processResetCredentials(boolean actionRequest, String execution, AuthenticationSessionModel authSession, String errorMessage)`
    `static javax.ws.rs.core.Response` | `redirectToAfterBrokerLoginEndpoint(KeycloakSession session, RealmModel realm, javax.ws.rs.core.UriInfo uriInfo, AuthenticationSessionModel authSession, boolean firstBrokerLogin)`
    `javax.ws.rs.core.Response` | `registerPage(String authSessionId, String code, String execution, String clientId, String tabId)` protocol independent registration page entry point
    `static javax.ws.rs.core.UriBuilder` | `registrationFormProcessor(javax.ws.rs.core.UriInfo uriInfo)`
    `javax.ws.rs.core.Response` | `requiredActionGET(String authSessionId, String code, String action, String clientId, String tabId)`
    `javax.ws.rs.core.Response` | `requiredActionPOST(String authSessionId, String code, String action, String clientId, String tabId)`
    `static javax.ws.rs.core.UriBuilder` | `requiredActionProcessor(javax.ws.rs.core.UriInfo uriInfo)`
    `protected javax.ws.rs.core.Response` | `resetCredentials(String authSessionId, String code, String execution, String clientId, String tabId)`
    `javax.ws.rs.core.Response` | `resetCredentialsGET(String authSessionId, String code, String execution, String clientId, String tabId)` Endpoint for executing reset credentials flow.
    `javax.ws.rs.core.Response` | `resetCredentialsPOST(String authSessionId, String code, String execution, String clientId, String tabId, String key)`
    `javax.ws.rs.core.Response` | `restartSession(String authSessionId, String clientId, String tabId)` protocol independent page for restart of the flow

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

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

- - ### Field Detail

    - #### AUTHENTICATE_PATH

          public static final String AUTHENTICATE_PATH

      See Also:
        Constant Field Values

    - #### REGISTRATION_PATH

          public static final String REGISTRATION_PATH

      See Also:
        Constant Field Values

    - #### RESET_CREDENTIALS_PATH

          public static final String RESET_CREDENTIALS_PATH

      See Also:
        Constant Field Values

    - #### REQUIRED_ACTION

          public static final String REQUIRED_ACTION

      See Also:
        Constant Field Values

    - #### FIRST_BROKER_LOGIN_PATH

          public static final String FIRST_BROKER_LOGIN_PATH

      See Also:
        Constant Field Values

    - #### POST_BROKER_LOGIN_PATH

          public static final String POST_BROKER_LOGIN_PATH

      See Also:
        Constant Field Values

    - #### RESTART_PATH

          public static final String RESTART_PATH

      See Also:
        Constant Field Values

    - #### FORWARDED_ERROR_MESSAGE_NOTE

          public static final String FORWARDED_ERROR_MESSAGE_NOTE

      See Also:
        Constant Field Values

    - #### SESSION_CODE

          public static final String SESSION_CODE

      See Also:
        Constant Field Values

    - #### AUTH_SESSION_ID

          public static final String AUTH_SESSION_ID

      See Also:
        Constant Field Values

    - #### CANCEL_AIA

          public static final String CANCEL_AIA

      See Also:
        Constant Field Values

    - #### headers

          @Context
          protected javax.ws.rs.core.HttpHeaders headers

    - #### providers

          @Context
          protected javax.ws.rs.ext.Providers providers

    - #### session

          @Context
          protected KeycloakSession session

  - ### Constructor Detail

    - #### LoginActionsService

          public LoginActionsService(RealmModel realm,
                                     EventBuilder event)

  - ### Method Detail

    - #### loginActionsBaseUrl

          public static javax.ws.rs.core.UriBuilder loginActionsBaseUrl(javax.ws.rs.core.UriInfo uriInfo)

    - #### authenticationFormProcessor

          public static javax.ws.rs.core.UriBuilder authenticationFormProcessor(javax.ws.rs.core.UriInfo uriInfo)

    - #### requiredActionProcessor

          public static javax.ws.rs.core.UriBuilder requiredActionProcessor(javax.ws.rs.core.UriInfo uriInfo)

    - #### actionTokenProcessor

          public static javax.ws.rs.core.UriBuilder actionTokenProcessor(javax.ws.rs.core.UriInfo uriInfo)

    - #### registrationFormProcessor

          public static javax.ws.rs.core.UriBuilder registrationFormProcessor(javax.ws.rs.core.UriInfo uriInfo)

    - #### firstBrokerLoginProcessor

          public static javax.ws.rs.core.UriBuilder firstBrokerLoginProcessor(javax.ws.rs.core.UriInfo uriInfo)

    - #### postBrokerLoginProcessor

          public static javax.ws.rs.core.UriBuilder postBrokerLoginProcessor(javax.ws.rs.core.UriInfo uriInfo)

    - #### loginActionsBaseUrl

          public static javax.ws.rs.core.UriBuilder loginActionsBaseUrl(javax.ws.rs.core.UriBuilder baseUriBuilder)

    - #### getLastExecutionUrl

          protected URI getLastExecutionUrl(String flowPath,
                                            String executionId,
                                            String clientId,
                                            String tabId)

    - #### restartSession

          @Path(value="restart")
           @GET
          public javax.ws.rs.core.Response restartSession(@QueryParam(value="auth_session_id")
                                                                                       String authSessionId,
                                                                                       @QueryParam(value="client_id")
                                                                                       String clientId,
                                                                                       @QueryParam(value="tab_id")
                                                                                       String tabId)

      protocol independent page for restart of the flow
      Returns:

    - #### authenticate

          @Path(value="authenticate")
           @GET
          public javax.ws.rs.core.Response authenticate(@QueryParam(value="auth_session_id")
                                                                                          String authSessionId,
                                                                                          @QueryParam(value="session_code")
                                                                                          String code,
                                                                                          @QueryParam(value="execution")
                                                                                          String execution,
                                                                                          @QueryParam(value="client_id")
                                                                                          String clientId,
                                                                                          @QueryParam(value="tab_id")
                                                                                          String tabId)

      protocol independent login page entry point
      Parameters:
        `code` -
      Returns:

    - #### processLocaleParam

          protected void processLocaleParam(AuthenticationSessionModel authSession)

    - #### processAuthentication

          protected javax.ws.rs.core.Response processAuthentication(boolean action,
                                                                    String execution,
                                                                    AuthenticationSessionModel authSession,
                                                                    String errorMessage)

    - #### processFlow

          protected javax.ws.rs.core.Response processFlow(boolean action,
                                                          String execution,
                                                          AuthenticationSessionModel authSession,
                                                          String flowPath,
                                                          AuthenticationFlowModel flow,
                                                          String errorMessage,
                                                          AuthenticationProcessor processor)

    - #### authenticateForm

          @Path(value="authenticate")
           @POST
          public javax.ws.rs.core.Response authenticateForm(@QueryParam(value="auth_session_id")
                                                                                               String authSessionId,
                                                                                               @QueryParam(value="session_code")
                                                                                               String code,
                                                                                               @QueryParam(value="execution")
                                                                                               String execution,
                                                                                               @QueryParam(value="client_id")
                                                                                               String clientId,
                                                                                               @QueryParam(value="tab_id")
                                                                                               String tabId)

      URL called after login page. YOU SHOULD NEVER INVOKE THIS DIRECTLY!
      Parameters:
        `code` -
      Returns:

    - #### resetCredentialsPOST

          @Path(value="reset-credentials")
           @POST
          public javax.ws.rs.core.Response resetCredentialsPOST(@QueryParam(value="auth_session_id")
                                                                                                        String authSessionId,
                                                                                                        @QueryParam(value="session_code")
                                                                                                        String code,
                                                                                                        @QueryParam(value="execution")
                                                                                                        String execution,
                                                                                                        @QueryParam(value="client_id")
                                                                                                        String clientId,
                                                                                                        @QueryParam(value="tab_id")
                                                                                                        String tabId,
                                                                                                        @QueryParam(value="key")
                                                                                                        String key)

    - #### resetCredentialsGET

          @Path(value="reset-credentials")
           @GET
          public javax.ws.rs.core.Response resetCredentialsGET(@QueryParam(value="auth_session_id")
                                                                                                      String authSessionId,
                                                                                                      @QueryParam(value="session_code")
                                                                                                      String code,
                                                                                                      @QueryParam(value="execution")
                                                                                                      String execution,
                                                                                                      @QueryParam(value="client_id")
                                                                                                      String clientId,
                                                                                                      @QueryParam(value="tab_id")
                                                                                                      String tabId)

      Endpoint for executing reset credentials flow. If token is null, a authentication session is created with the account service as the client. Successful reset sends you to the account page. Note, account service must be enabled.
      Parameters:
        `code` -
        `execution` -
      Returns:

    - #### resetCredentials

          protected javax.ws.rs.core.Response resetCredentials(String authSessionId,
                                                               String code,
                                                               String execution,
                                                               String clientId,
                                                               String tabId)

      Parameters:
        `code` -
        `execution` -
      Returns:

    - #### executeActionToken

          @Path(value="action-token")
           @GET
          public javax.ws.rs.core.Response executeActionToken(@QueryParam(value="auth_session_id")
                                                                                                String authSessionId,
                                                                                                @QueryParam(value="key")
                                                                                                String key,
                                                                                                @QueryParam(value="execution")
                                                                                                String execution,
                                                                                                @QueryParam(value="client_id")
                                                                                                String clientId,
                                                                                                @QueryParam(value="tab_id")
                                                                                                String tabId)

      Handles a given token using the given token handler. If there is any `VerificationException` thrown in the handler, it is handled automatically here to reduce boilerplate code.
      Parameters:
        `key` -
        `execution` -
      Returns:

    - #### handleActionToken

          protected <T extends JsonWebToken & ActionTokenKeyModel> javax.ws.rs.core.Response handleActionToken(String tokenString,
                                                                                                               String execution,
                                                                                                               String clientId,
                                                                                                               String tabId)

    - #### processResetCredentials

          protected javax.ws.rs.core.Response processResetCredentials(boolean actionRequest,
                                                                      String execution,
                                                                      AuthenticationSessionModel authSession,
                                                                      String errorMessage)

    - #### processRegistration

          protected javax.ws.rs.core.Response processRegistration(boolean action,
                                                                  String execution,
                                                                  AuthenticationSessionModel authSession,
                                                                  String errorMessage)

    - #### registerPage

          @Path(value="registration")
           @GET
          public javax.ws.rs.core.Response registerPage(@QueryParam(value="auth_session_id")
                                                                                          String authSessionId,
                                                                                          @QueryParam(value="session_code")
                                                                                          String code,
                                                                                          @QueryParam(value="execution")
                                                                                          String execution,
                                                                                          @QueryParam(value="client_id")
                                                                                          String clientId,
                                                                                          @QueryParam(value="tab_id")
                                                                                          String tabId)

      protocol independent registration page entry point
      Parameters:
        `code` -
      Returns:

    - #### processRegister

          @Path(value="registration")
           @POST
          public javax.ws.rs.core.Response processRegister(@QueryParam(value="auth_session_id")
                                                                                              String authSessionId,
                                                                                              @QueryParam(value="session_code")
                                                                                              String code,
                                                                                              @QueryParam(value="execution")
                                                                                              String execution,
                                                                                              @QueryParam(value="client_id")
                                                                                              String clientId,
                                                                                              @QueryParam(value="tab_id")
                                                                                              String tabId)

      Registration
      Parameters:
        `code` -
      Returns:

    - #### firstBrokerLoginGet

          @Path(value="first-broker-login")
           @GET
          public javax.ws.rs.core.Response firstBrokerLoginGet(@QueryParam(value="auth_session_id")
                                                                                                       String authSessionId,
                                                                                                       @QueryParam(value="session_code")
                                                                                                       String code,
                                                                                                       @QueryParam(value="execution")
                                                                                                       String execution,
                                                                                                       @QueryParam(value="client_id")
                                                                                                       String clientId,
                                                                                                       @QueryParam(value="tab_id")
                                                                                                       String tabId)

    - #### firstBrokerLoginPost

          @Path(value="first-broker-login")
           @POST
          public javax.ws.rs.core.Response firstBrokerLoginPost(@QueryParam(value="auth_session_id")
                                                                                                         String authSessionId,
                                                                                                         @QueryParam(value="session_code")
                                                                                                         String code,
                                                                                                         @QueryParam(value="execution")
                                                                                                         String execution,
                                                                                                         @QueryParam(value="client_id")
                                                                                                         String clientId,
                                                                                                         @QueryParam(value="tab_id")
                                                                                                         String tabId)

    - #### postBrokerLoginGet

          @Path(value="post-broker-login")
           @GET
          public javax.ws.rs.core.Response postBrokerLoginGet(@QueryParam(value="auth_session_id")
                                                                                                     String authSessionId,
                                                                                                     @QueryParam(value="session_code")
                                                                                                     String code,
                                                                                                     @QueryParam(value="execution")
                                                                                                     String execution,
                                                                                                     @QueryParam(value="client_id")
                                                                                                     String clientId,
                                                                                                     @QueryParam(value="tab_id")
                                                                                                     String tabId)

    - #### postBrokerLoginPost

          @Path(value="post-broker-login")
           @POST
          public javax.ws.rs.core.Response postBrokerLoginPost(@QueryParam(value="auth_session_id")
                                                                                                       String authSessionId,
                                                                                                       @QueryParam(value="session_code")
                                                                                                       String code,
                                                                                                       @QueryParam(value="execution")
                                                                                                       String execution,
                                                                                                       @QueryParam(value="client_id")
                                                                                                       String clientId,
                                                                                                       @QueryParam(value="tab_id")
                                                                                                       String tabId)

    - #### brokerLoginFlow

          protected javax.ws.rs.core.Response brokerLoginFlow(String authSessionId,
                                                              String code,
                                                              String execution,
                                                              String clientId,
                                                              String tabId,
                                                              String flowPath)

    - #### redirectToAfterBrokerLoginEndpoint

          public static javax.ws.rs.core.Response redirectToAfterBrokerLoginEndpoint(KeycloakSession session,
                                                                                     RealmModel realm,
                                                                                     javax.ws.rs.core.UriInfo uriInfo,
                                                                                     AuthenticationSessionModel authSession,
                                                                                     boolean firstBrokerLogin)

    - #### processConsent

          @Path(value="consent")
           @POST
           @Consumes(value="application/x-www-form-urlencoded")
          public javax.ws.rs.core.Response processConsent()

      OAuth grant page. You should not invoked this directly!
      Parameters:
        `formData` -
      Returns:

    - #### requiredActionPOST

          @Path(value="required-action")
           @POST
          public javax.ws.rs.core.Response requiredActionPOST(@QueryParam(value="auth_session_id")
                                                                                                    String authSessionId,
                                                                                                    @QueryParam(value="session_code")
                                                                                                    String code,
                                                                                                    @QueryParam(value="execution")
                                                                                                    String action,
                                                                                                    @QueryParam(value="client_id")
                                                                                                    String clientId,
                                                                                                    @QueryParam(value="tab_id")
                                                                                                    String tabId)

    - #### requiredActionGET

          @Path(value="required-action")
           @GET
          public javax.ws.rs.core.Response requiredActionGET(@QueryParam(value="auth_session_id")
                                                                                                  String authSessionId,
                                                                                                  @QueryParam(value="session_code")
                                                                                                  String code,
                                                                                                  @QueryParam(value="execution")
                                                                                                  String action,
                                                                                                  @QueryParam(value="client_id")
                                                                                                  String clientId,
                                                                                                  @QueryParam(value="tab_id")
                                                                                                  String tabId)

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