org.keycloak.adapters.jaas

## Class DirectAccessGrantsLoginModule

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

- All Implemented Interfaces:
    LoginModule

      public class DirectAccessGrantsLoginModule
      extends AbstractKeycloakLoginModule

  Login module based on Resource Owner password credentials grant from OAuth2 specs. It's supposed to be used in environments. which can't rely on HTTP (like SSH authentication for instance). It needs that Direct Grant is enabled on particular realm in Keycloak.
  Author:
    Marek Posolda

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.keycloak.adapters.jaas.AbstractKeycloakLoginModule

      `AbstractKeycloakLoginModule.Auth`

  - ### Field Summary

    - ### Fields inherited from class org.keycloak.adapters.jaas.AbstractKeycloakLoginModule

      `auth, callbackHandler, deployment, KEYCLOAK_CONFIG_FILE_OPTION, subject`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DirectAccessGrantsLoginModule()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `commit()`
    `protected AbstractKeycloakLoginModule.Auth` | `directGrantAuth(String username, String password)`
    `protected AbstractKeycloakLoginModule.Auth` | `doAuth(String username, String password)`
    `protected org.jboss.logging.Logger` | `getLogger()`
    `void` | `initialize(Subject subject, CallbackHandler callbackHandler, Map<String,?> sharedState, Map<String,?> options)`
    `boolean` | `logout()`

    - ### Methods inherited from class org.keycloak.adapters.jaas.AbstractKeycloakLoginModule

      `abort, bearerAuth, login, resolveDeployment`

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

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

- - ### Constructor Detail

    - #### DirectAccessGrantsLoginModule

          public DirectAccessGrantsLoginModule()

  - ### Method Detail

    - #### initialize

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

      Specified by:
        `initialize` in interface `LoginModule`
      Overrides:
        `initialize` in class `AbstractKeycloakLoginModule`

    - #### doAuth

          protected AbstractKeycloakLoginModule.Auth doAuth(String username,
                                                String password)
                                                     throws IOException,
                                                            VerificationException

      Specified by:
        `doAuth` in class `AbstractKeycloakLoginModule`
      Throws:
        `IOException`
        `VerificationException`

    - #### getLogger

          protected org.jboss.logging.Logger getLogger()

      Specified by:
        `getLogger` in class `AbstractKeycloakLoginModule`

    - #### directGrantAuth

          protected AbstractKeycloakLoginModule.Auth directGrantAuth(String username,
                                                         String password)
                                                              throws IOException,
                                                                     VerificationException

      Throws:
        `IOException`
        `VerificationException`

    - #### commit

          public boolean commit()
                         throws LoginException

      Specified by:
        `commit` in interface `LoginModule`
      Overrides:
        `commit` in class `AbstractKeycloakLoginModule`
      Throws:
        `LoginException`

    - #### logout

          public boolean logout()
                         throws LoginException

      Specified by:
        `logout` in interface `LoginModule`
      Overrides:
        `logout` in class `AbstractKeycloakLoginModule`
      Throws:
        `LoginException`

Copyright © 2014. All Rights Reserved.