Package org.apache.activemq.artemis.spi.core.security.jaas

## Class LDAPLoginModule

- java.lang.Object
- - org.apache.activemq.artemis.spi.core.security.jaas.LDAPLoginModule

- All Implemented Interfaces:
    `javax.security.auth.spi.LoginModule`, `AuditLoginModule`

      public class LDAPLoginModule
      extends java.lang.Object
      implements AuditLoginModule

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `protected javax.naming.directory.DirContext` | `context` |

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `LDAPLoginModule()` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `boolean` | `abort()` |
    `protected void` | `addRoles​(javax.naming.directory.DirContext context, java.lang.String dn, java.lang.String username, java.util.List<java.lang.String> currentRoles)` |
    `protected boolean` | `authenticate​(java.lang.String username, java.lang.String password)` |
    `protected boolean` | `bindUser​(javax.naming.directory.DirContext context, java.lang.String dn, java.lang.String password)` |
    `protected void` | `closeContext()` |
    `boolean` | `commit()` |
    `protected java.lang.String` | `doRFC2254Encoding​(java.lang.String inputString)` |
    `protected void` | `extendInitialEnvironment​(java.util.Set<LDAPLoginProperty> moduleConfig, java.util.Hashtable<java.lang.String,​java.lang.String> initialContextEnv)` |
    `void` | `initialize​(javax.security.auth.Subject subject, javax.security.auth.callback.CallbackHandler callbackHandler, java.util.Map<java.lang.String,​?> sharedState, java.util.Map<java.lang.String,​?> options)` |
    `boolean` | `login()` |
    `boolean` | `logout()` |
    `protected void` | `openContext()` |

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

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

    - ### Methods inherited from interface org.apache.activemq.artemis.spi.core.security.jaas.AuditLoginModule

      `registerFailureForAudit`

- - ### Field Detail

    - #### context

          protected javax.naming.directory.DirContext context

  - ### Constructor Detail

    - #### LDAPLoginModule

          public LDAPLoginModule()

  - ### Method Detail

    - #### initialize

          public void initialize​(javax.security.auth.Subject subject,
                                 javax.security.auth.callback.CallbackHandler callbackHandler,
                                 java.util.Map<java.lang.String,​?> sharedState,
                                 java.util.Map<java.lang.String,​?> options)

      Specified by:
        `initialize` in interface `javax.security.auth.spi.LoginModule`

    - #### login

          public boolean login()
                        throws javax.security.auth.login.LoginException

      Specified by:
        `login` in interface `javax.security.auth.spi.LoginModule`
      Throws:
        `javax.security.auth.login.LoginException`

    - #### logout

          public boolean logout()
                         throws javax.security.auth.login.LoginException

      Specified by:
        `logout` in interface `javax.security.auth.spi.LoginModule`
      Throws:
        `javax.security.auth.login.LoginException`

    - #### commit

          public boolean commit()
                         throws javax.security.auth.login.LoginException

      Specified by:
        `commit` in interface `javax.security.auth.spi.LoginModule`
      Throws:
        `javax.security.auth.login.LoginException`

    - #### abort

          public boolean abort()
                        throws javax.security.auth.login.LoginException

      Specified by:
        `abort` in interface `javax.security.auth.spi.LoginModule`
      Throws:
        `javax.security.auth.login.LoginException`

    - #### closeContext

          protected void closeContext()

    - #### authenticate

          protected boolean authenticate​(java.lang.String username,
                                         java.lang.String password)
                                  throws javax.security.auth.login.LoginException

      Throws:
        `javax.security.auth.login.LoginException`

    - #### addRoles

          protected void addRoles​(javax.naming.directory.DirContext context,
                                  java.lang.String dn,
                                  java.lang.String username,
                                  java.util.List<java.lang.String> currentRoles)
                           throws javax.naming.NamingException

      Throws:
        `javax.naming.NamingException`

    - #### doRFC2254Encoding

          protected java.lang.String doRFC2254Encoding​(java.lang.String inputString)

    - #### bindUser

          protected boolean bindUser​(javax.naming.directory.DirContext context,
                                     java.lang.String dn,
                                     java.lang.String password)
                              throws javax.naming.NamingException

      Throws:
        `javax.naming.NamingException`

    - #### openContext

          protected void openContext()
                              throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### extendInitialEnvironment

          protected void extendInitialEnvironment​(java.util.Set<LDAPLoginProperty> moduleConfig,
                                                  java.util.Hashtable<java.lang.String,​java.lang.String> initialContextEnv)