Class LdapRoleAuthorizationModule

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

    public class LdapRoleAuthorizationModule
    extends AbstractLoginModule
    Provides a JAAS authentication hook into LDAP roles. No authentication is performed in this module. Role data is set for the login name in the shared state or for the name returned by the CallbackHandler.
    Author:
    Middleware Services
    • Constructor Detail

      • LdapRoleAuthorizationModule

        public LdapRoleAuthorizationModule()
    • 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