Package org.ldaptive.jaas
Class LdapRoleAuthorizationModule
java.lang.Object
org.ldaptive.jaas.AbstractLoginModule
org.ldaptive.jaas.LdapRoleAuthorizationModule
- All Implemented Interfaces:
LoginModule
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.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate boolean
Whether failing to find any roles should raise an exception.private String[]
Role attribute to add to role data.private String
Ldap filter for role searches.private RoleResolver
To search for roles.private RoleResolverFactory
Factory for creating role resolvers with JAAS options.private SearchRequest
Search request to use for roles.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 -
Method Summary
Modifier and TypeMethodDescriptionvoid
initialize
(Subject subject, CallbackHandler callbackHandler, Map<String, ?> sharedState, Map<String, ?> options) protected boolean
login
(NameCallback nameCb, PasswordCallback passCb) Authenticates aSubject
with the supplied callbacks.static void
This provides command line access to this JAAS module.Methods inherited from class org.ldaptive.jaas.AbstractLoginModule
abort, clearState, commit, getCredentials, login, logout, storeCredentials
-
Field Details
-
roleFilter
Ldap filter for role searches. -
roleAttribute
Role attribute to add to role data. -
noResultsIsError
private boolean noResultsIsErrorWhether failing to find any roles should raise an exception. -
roleResolverFactory
Factory for creating role resolvers with JAAS options. -
roleResolver
To search for roles. -
searchRequest
Search request to use for roles.
-
-
Constructor Details
-
LdapRoleAuthorizationModule
public LdapRoleAuthorizationModule()
-
-
Method Details
-
initialize
public void initialize(Subject subject, CallbackHandler callbackHandler, Map<String, ?> sharedState, Map<String, ?> options) - Specified by:
initialize
in interfaceLoginModule
- Overrides:
initialize
in classAbstractLoginModule
-
login
Description copied from class:AbstractLoginModule
Authenticates aSubject
with the supplied callbacks.- Specified by:
login
in 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:
LoginException
- if the authentication fails
-
main
This provides command line access to this JAAS module.- Parameters:
args
- command line arguments- Throws:
Exception
- if an error occurs
-