Class LdapLoginModule

  • All Implemented Interfaces:
    javax.security.auth.spi.LoginModule

    public class LdapLoginModule
    extends AbstractLoginModule
    Provides a JAAS authentication hook for LDAP authentication.
    Author:
    Middleware Services
    • 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
        Overrides:
        initialize in class AbstractLoginModule
      • login

        protected boolean login​(javax.security.auth.callback.NameCallback nameCb,
                                javax.security.auth.callback.PasswordCallback passCb)
                         throws javax.security.auth.login.LoginException
        Description copied from class: AbstractLoginModule
        Authenticates a Subject with the supplied callbacks.
        Specified by:
        login in class AbstractLoginModule
        Parameters:
        nameCb - callback handler for subject's name
        passCb - callback handler for subject's password
        Returns:
        true if authentication succeeded, false to ignore this module
        Throws:
        javax.security.auth.login.LoginException - if the authentication fails
      • main

        public static void main​(java.lang.String[] args)
                         throws java.lang.Exception
        This provides command line access to this JAAS module.
        Parameters:
        args - command line arguments
        Throws:
        java.lang.Exception - if an error occurs