Class AttributeMapping
- java.lang.Object
-
- org.wildfly.security.auth.realm.ldap.AttributeMapping
-
public class AttributeMapping extends Object
Definition of a mapping from LDAP to an Elytron attribute.- Author:
- Darran Lofthouse
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AttributeMapping.Builder
-
Field Summary
Fields Modifier and Type Field Description static String
DEFAULT_DN_NAME
static String
DEFAULT_FILTERED_NAME
static String
DEFAULT_ROLE_RECURSION_ATTRIBUTE
private String
filter
private String
ldapName
private String
name
private String
rdn
private boolean
recursiveSearch
private String
reference
private int
roleRecursionDepth
private String
roleRecursionName
private String
searchDn
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static AttributeMapping.Builder
fromFilter(String filter)
Create an attribute mapping based on the results of the givenfilter
.static AttributeMapping.Builder
fromIdentity()
Create an attribute mapping using LDAP entry of identity itself.static AttributeMapping.Builder
fromReference(String reference)
Create an attribute mapping using LDAP entry referenced by attribute of identity entry.(package private) String
getFilter()
(package private) String
getIdentityLdapName()
Get name of LDAP attribute to obtain from identity entry(package private) String
getLdapName()
(package private) String
getName()
(package private) String
getRdn()
(package private) boolean
getRecursiveSearch()
(package private) String
getReference()
(package private) int
getRoleRecursionDepth()
(package private) String
getRoleRecursionName()
(package private) String
getSearchDn()
(package private) boolean
isFilteredOrReference()
(package private) boolean
searchInIdentityContext()
Determine which context should be used to search filtered/referenced entry.
-
-
-
Field Detail
-
DEFAULT_FILTERED_NAME
public static final String DEFAULT_FILTERED_NAME
- See Also:
- Constant Field Values
-
DEFAULT_DN_NAME
public static final String DEFAULT_DN_NAME
- See Also:
- Constant Field Values
-
DEFAULT_ROLE_RECURSION_ATTRIBUTE
public static final String DEFAULT_ROLE_RECURSION_ATTRIBUTE
- See Also:
- Constant Field Values
-
ldapName
private final String ldapName
-
searchDn
private final String searchDn
-
recursiveSearch
private final boolean recursiveSearch
-
filter
private final String filter
-
reference
private final String reference
-
name
private final String name
-
rdn
private final String rdn
-
roleRecursionDepth
private final int roleRecursionDepth
-
roleRecursionName
private final String roleRecursionName
-
-
Method Detail
-
getLdapName
String getLdapName()
-
getIdentityLdapName
String getIdentityLdapName()
Get name of LDAP attribute to obtain from identity entry- Returns:
- LDAP attribute to obtain from identity entry
-
getName
String getName()
-
getSearchDn
String getSearchDn()
-
getRecursiveSearch
boolean getRecursiveSearch()
-
getFilter
String getFilter()
-
getRdn
String getRdn()
-
getReference
String getReference()
-
getRoleRecursionDepth
int getRoleRecursionDepth()
-
getRoleRecursionName
String getRoleRecursionName()
-
isFilteredOrReference
boolean isFilteredOrReference()
-
searchInIdentityContext
boolean searchInIdentityContext()
Determine which context should be used to search filtered/referenced entry. Has effect if the identity is behind referral, in different context. Iftrue
, attribute will be searched in context, where was the identity found.DirContext
of the LdapRealm will be used otherwise.
-
fromIdentity
public static AttributeMapping.Builder fromIdentity()
Create an attribute mapping using LDAP entry of identity itself.
- Returns:
- this builder
-
fromFilter
public static AttributeMapping.Builder fromFilter(String filter)
Create an attribute mapping based on the results of the given
filter
.The
filter
may have one and exactly one {0} string that will be used to replace with the distinguished name of the identity. In this case, the filter is specially useful when the values for this attribute should be obtained from a separated entry. For instance, retrieving roles from entries with a object class of groupOfNames where the identity's DN is a value of a member attribute.- Parameters:
filter
- the filter that is going to be used to search for entries and obtain values for this attribute- Returns:
- this builder
-
fromReference
public static AttributeMapping.Builder fromReference(String reference)
Create an attribute mapping using LDAP entry referenced by attribute of identity entry.
- Parameters:
reference
- the name of LDAP attribute containing DN of LDAP entry, from which should be value loaded.- Returns:
- this builder
-
-