Class LdapSecurityRealmBuilder.IdentityMappingBuilder
- java.lang.Object
-
- org.wildfly.security.auth.realm.ldap.LdapSecurityRealmBuilder.IdentityMappingBuilder
-
- Enclosing class:
- LdapSecurityRealmBuilder
public class LdapSecurityRealmBuilder.IdentityMappingBuilder extends Object
A builder for a principal mapping.
-
-
Field Summary
Fields Modifier and Type Field Description private List<AttributeMapping>
attributes
private boolean
built
private String
filterName
private String
iteratorFilter
private String
nameAttribute
private Attributes
newIdentityAttributes
private LdapName
newIdentityParent
private String
searchDn
private boolean
searchRecursive
private int
searchTimeLimit
-
Constructor Summary
Constructors Constructor Description IdentityMappingBuilder()
-
Method Summary
-
-
-
Field Detail
-
built
private boolean built
-
searchDn
private String searchDn
-
searchRecursive
private boolean searchRecursive
-
nameAttribute
private String nameAttribute
-
searchTimeLimit
private int searchTimeLimit
-
attributes
private List<AttributeMapping> attributes
-
newIdentityParent
private LdapName newIdentityParent
-
newIdentityAttributes
private Attributes newIdentityAttributes
-
filterName
private String filterName
-
iteratorFilter
private String iteratorFilter
-
-
Method Detail
-
setSearchDn
public LdapSecurityRealmBuilder.IdentityMappingBuilder setSearchDn(String searchDn)
Set the name of the context to be used when executing queries.
This option is specially useful when authenticating users based on names that don't use a X.500 format such as plainUser. In this case, you must also provide
setRdnIdentifier(String)
with the attribute name that contains the user name.If the names used to authenticate users are based on the X.500 format, this configuration can be suppressed.
Please note that by using this option the realm is able to authenticate users based on their simple or X.500 names.
- Parameters:
searchDn
- the name of the context to search- Returns:
- this builder
-
searchRecursive
public LdapSecurityRealmBuilder.IdentityMappingBuilder searchRecursive()
Indicate if queries are searchRecursive, searching the entire subtree rooted at the name specified insetSearchDn(String)
. Otherwise search one level of the named context.- Returns:
- this builder
-
setSearchTimeLimit
public LdapSecurityRealmBuilder.IdentityMappingBuilder setSearchTimeLimit(int limit)
Sets the time limit of LDAP search in milliseconds.- Parameters:
limit
- the limit in milliseconds. Defaults to 10000 milliseconds.- Returns:
- this builder
-
setRdnIdentifier
public LdapSecurityRealmBuilder.IdentityMappingBuilder setRdnIdentifier(String nameAttribute)
Set the name of the attribute in LDAP that holds the user name and will appear in path of new entries.- Parameters:
nameAttribute
- the name attribute- Returns:
- this builder
-
setNewIdentityParent
public LdapSecurityRealmBuilder.IdentityMappingBuilder setNewIdentityParent(LdapName newIdentityParent)
-
setNewIdentityAttributes
public LdapSecurityRealmBuilder.IdentityMappingBuilder setNewIdentityAttributes(Attributes newIdentityAttributes)
-
setFilterName
public LdapSecurityRealmBuilder.IdentityMappingBuilder setFilterName(String filterName)
-
setIteratorFilter
public LdapSecurityRealmBuilder.IdentityMappingBuilder setIteratorFilter(String iteratorFilter)
-
map
public LdapSecurityRealmBuilder.IdentityMappingBuilder map(AttributeMapping... attributes)
Define an attribute mapping configuration.- Parameters:
attributes
- one or moreAttributeMapping
configuration- Returns:
- this builder
-
build
public LdapSecurityRealmBuilder build()
-
assertNotBuilt
private void assertNotBuilt()
-
-