public class LdapUserGroupsToRolesAuthorizationGenerator extends BaseUseAttributesAuthorizationGenerator
AuthorizationGenerator
implementation that obtains user roles from an LDAP search.
Two searches are performed by this component for every user details lookup:
BaseUseAttributesAuthorizationGenerator.allowMultipleResults
property may be toggled to change that behavior.connectionFactory
Constructor and Description |
---|
LdapUserGroupsToRolesAuthorizationGenerator(org.ldaptive.ConnectionFactory factory,
org.ldaptive.SearchExecutor userSearchExecutor,
boolean allowMultipleResults,
java.lang.String groupAttributeName,
java.lang.String groupPrefix,
org.ldaptive.SearchExecutor groupSearchExecutor)
Instantiates a new Ldap user groups to roles authorization generator.
|
Modifier and Type | Method and Description |
---|---|
protected org.pac4j.core.profile.CommonProfile |
generateAuthorizationForLdapEntry(org.pac4j.core.profile.CommonProfile profile,
org.ldaptive.LdapEntry userEntry)
Generate authorization for ldap entry.
|
addProfileRoles, addProfileRolesFromAttributes, generate
public LdapUserGroupsToRolesAuthorizationGenerator(org.ldaptive.ConnectionFactory factory, org.ldaptive.SearchExecutor userSearchExecutor, boolean allowMultipleResults, java.lang.String groupAttributeName, java.lang.String groupPrefix, org.ldaptive.SearchExecutor groupSearchExecutor)
factory
- the factoryuserSearchExecutor
- the user search executorallowMultipleResults
- the allow multiple resultsgroupAttributeName
- the group attribute namegroupPrefix
- the group prefixgroupSearchExecutor
- the group search executorprotected org.pac4j.core.profile.CommonProfile generateAuthorizationForLdapEntry(org.pac4j.core.profile.CommonProfile profile, org.ldaptive.LdapEntry userEntry)
BaseUseAttributesAuthorizationGenerator
generateAuthorizationForLdapEntry
in class BaseUseAttributesAuthorizationGenerator
profile
- the profileuserEntry
- the user entry