org.keycloak.adapters.jaas

## Class AbstractKeycloakLoginModule

- java.lang.Object
- - org.keycloak.adapters.jaas.AbstractKeycloakLoginModule

- All Implemented Interfaces:
    LoginModule
  Direct Known Subclasses:
    BearerTokenLoginModule, DirectAccessGrantsLoginModule

      public abstract class AbstractKeycloakLoginModule
      extends Object
      implements LoginModule

  Author:
    Marek Posolda

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `AbstractKeycloakLoginModule.Auth`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected AbstractKeycloakLoginModule.Auth` | `auth`
    `protected CallbackHandler` | `callbackHandler`
    `protected KeycloakDeployment` | `deployment`
    `static String` | `KEYCLOAK_CONFIG_FILE_OPTION`
    `static String` | `ROLE_PRINCIPAL_CLASS_OPTION`
    `protected String` | `rolePrincipalClass`
    `protected Subject` | `subject`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AbstractKeycloakLoginModule()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `abort()`
    `protected AbstractKeycloakLoginModule.Auth` | `bearerAuth(String tokenString)`
    `boolean` | `commit()`
    `protected Principal` | `createRolePrincipal(String roleName)`
    `protected abstract AbstractKeycloakLoginModule.Auth` | `doAuth(String username, String password)`
    `protected abstract org.jboss.logging.Logger` | `getLogger()`
    `void` | `initialize(Subject subject, CallbackHandler callbackHandler, Map<String,?> sharedState, Map<String,?> options)`
    `boolean` | `login()`
    `boolean` | `logout()`
    `protected KeycloakDeployment` | `resolveDeployment(String keycloakConfigFile)`

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

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

- - ### Field Detail

    - #### KEYCLOAK_CONFIG_FILE_OPTION

          public static final String KEYCLOAK_CONFIG_FILE_OPTION

      See Also:
        Constant Field Values

    - #### ROLE_PRINCIPAL_CLASS_OPTION

          public static final String ROLE_PRINCIPAL_CLASS_OPTION

      See Also:
        Constant Field Values

    - #### subject

          protected Subject subject

    - #### callbackHandler

          protected CallbackHandler callbackHandler

    - #### auth

          protected AbstractKeycloakLoginModule.Auth auth

    - #### deployment

          protected KeycloakDeployment deployment

    - #### rolePrincipalClass

          protected String rolePrincipalClass

  - ### Constructor Detail

    - #### AbstractKeycloakLoginModule

          public AbstractKeycloakLoginModule()

  - ### Method Detail

    - #### initialize

          public void initialize(Subject subject,
                        CallbackHandler callbackHandler,
                        Map<String,?> sharedState,
                        Map<String,?> options)

      Specified by:
        `initialize` in interface `LoginModule`

    - #### resolveDeployment

          protected KeycloakDeployment resolveDeployment(String keycloakConfigFile)

    - #### login

          public boolean login()
                        throws LoginException

      Specified by:
        `login` in interface `LoginModule`
      Throws:
        `LoginException`

    - #### commit

          public boolean commit()
                         throws LoginException

      Specified by:
        `commit` in interface `LoginModule`
      Throws:
        `LoginException`

    - #### createRolePrincipal

          protected Principal createRolePrincipal(String roleName)

    - #### abort

          public boolean abort()
                        throws LoginException

      Specified by:
        `abort` in interface `LoginModule`
      Throws:
        `LoginException`

    - #### logout

          public boolean logout()
                         throws LoginException

      Specified by:
        `logout` in interface `LoginModule`
      Throws:
        `LoginException`

    - #### bearerAuth

          protected AbstractKeycloakLoginModule.Auth bearerAuth(String tokenString)
                                                         throws VerificationException

      Throws:
        `VerificationException`

    - #### doAuth

          protected abstract AbstractKeycloakLoginModule.Auth doAuth(String username,
                                                String password)
                                                              throws Exception

      Throws:
        `Exception`

    - #### getLogger

          protected abstract org.jboss.logging.Logger getLogger()

Copyright © 2015. All Rights Reserved.