Package org.ldaptive.jaas
Class LdapRoleAuthorizationModule
- java.lang.Object
-
- org.ldaptive.jaas.AbstractLoginModule
-
- org.ldaptive.jaas.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
-
-
Field Summary
-
Fields inherited from class org.ldaptive.jaas.AbstractLoginModule
callbackHandler, clearPass, commitSuccess, credentials, defaultRole, logger, LOGIN_DN, LOGIN_NAME, LOGIN_PASSWORD, loginSuccess, principalGroupName, principals, roleGroupName, roles, setLdapCredential, setLdapDnPrincipal, setLdapPrincipal, sharedState, storePass, subject, tryFirstPass, useFirstPass
-
-
Constructor Summary
Constructors Constructor Description LdapRoleAuthorizationModule()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidinitialize(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)protected booleanlogin(javax.security.auth.callback.NameCallback nameCb, javax.security.auth.callback.PasswordCallback passCb)Authenticates aSubjectwith the supplied callbacks.static voidmain(java.lang.String[] args)This provides command line access to this JAAS module.-
Methods inherited from class org.ldaptive.jaas.AbstractLoginModule
abort, clearState, commit, getCredentials, login, logout, storeCredentials
-
-
-
-
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:
initializein interfacejavax.security.auth.spi.LoginModule- Overrides:
initializein classAbstractLoginModule
-
login
protected boolean login(javax.security.auth.callback.NameCallback nameCb, javax.security.auth.callback.PasswordCallback passCb) throws javax.security.auth.login.LoginExceptionDescription copied from class:AbstractLoginModuleAuthenticates aSubjectwith the supplied callbacks.- Specified by:
loginin classAbstractLoginModule- Parameters:
nameCb- callback handler for subject's namepassCb- 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.ExceptionThis provides command line access to this JAAS module.- Parameters:
args- command line arguments- Throws:
java.lang.Exception- if an error occurs
-
-