public class LdapAuthenticationHandler extends Object
| Constructor and Description |
|---|
LdapAuthenticationHandler(String baseUrl,
String baseDn,
String ldapSecurityPrincipal,
String ldapSecurityCredentials)
Creates an LDAP authenticator for the specified server and base DN, using
the default identifier attribute "uid"
|
LdapAuthenticationHandler(String baseUrl,
String baseDn,
String ldapSecurityPrincipal,
String ldapSecurityCredentials,
String ldapRoleAttr,
String idAttr)
Creates an LDAP authenticator for the specified server, base DN and given
identifier attribute
|
LdapAuthenticationHandler(String baseUrl,
String baseDn,
String ldapSecurityPrincipal,
String ldapSecurityCredentials,
String ldapRoleAttr,
String idAttr,
Map<String,List<String>> ldapRolesMap)
Creates an LDAP authenticator for the specified server, base DN and given
identifier attribute
|
LdapAuthenticationHandler(String baseUrl,
String baseDn,
String ldapSecurityPrincipal,
String ldapSecurityCredentials,
String ldapRoleAttr,
String idAttr,
String filterPrefix,
String filterSuffix,
Map<String,List<String>> ldapRolesMap)
Creates an LDAP authenticator for the specified server, base DN and given
identifier attribute
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
authenticate(String username,
String password)
Tries to authenticate user by using default settings, otherwise searches
for the DN of the user
|
List<String> |
getAllAttrs(String username,
String attrName)
Tries to find the value(s) of the given attribute.
|
List<Map<String,List<String>>> |
getAllAttrValues(String[] term,
String searchString)
Performs an LDAP search using the search string and the term(s).
|
String |
getAttr(String username,
String attrName)
Tries to find the value of the given attribute.
|
List<Map<String,String>> |
getAttrs(String username,
List<String> attrNames)
Retrieves the attributes for this user.
|
List<String> |
getRoles(String username)
Get the list of roles that the user is a member of.
|
boolean |
testIfInObjectClass(String username,
String testSubj)
Searches through the role attribute values and tries to match the given
string.
|
void |
useSystemCred()
Reverts credentials to use system's rather than the currently logged in user.
|
public LdapAuthenticationHandler(String baseUrl, String baseDn, String ldapSecurityPrincipal, String ldapSecurityCredentials)
baseUrl - LDAP server URLbaseDn - LDAP base DNpublic LdapAuthenticationHandler(String baseUrl, String baseDn, String ldapSecurityPrincipal, String ldapSecurityCredentials, String ldapRoleAttr, String idAttr)
baseUrl - LDAP server URLbaseDn - LDAP base DNldapSecurityPrincipal - LDAP Security PrincipalldapSecurityCredentials - Credentials for Security PrincipalldapRoleAttr - Name of the LDAP attribute that defines the roleidAttr - LDAP user identifier attributepublic LdapAuthenticationHandler(String baseUrl, String baseDn, String ldapSecurityPrincipal, String ldapSecurityCredentials, String ldapRoleAttr, String idAttr, Map<String,List<String>> ldapRolesMap)
baseUrl - LDAP server URLbaseDn - LDAP base DNldapSecurityPrincipal - LDAP Security PrincipalldapSecurityCredentials - Credentials for Security PrincipalldapRoleAttr - Name of the LDAP attribute that defines the roleidAttr - LDAP user identifier attributeldapRolesMap - Maps relevant LDAP roles to Fascinator rolespublic LdapAuthenticationHandler(String baseUrl, String baseDn, String ldapSecurityPrincipal, String ldapSecurityCredentials, String ldapRoleAttr, String idAttr, String filterPrefix, String filterSuffix, Map<String,List<String>> ldapRolesMap)
baseUrl - LDAP server URLbaseDn - LDAP base DNldapSecurityPrincipal - LDAP Security PrincipalldapSecurityCredentials - Credentials for Security PrincipalldapRoleAttr - Name of the LDAP attribute that defines the roleidAttr - LDAP user identifier attributeldapRolesMap - Maps relevant LDAP roles to Fascinator rolespublic boolean authenticate(String username, String password)
username - a usernamepassword - a passwordtrue if authentication was successful,
false otherwisepublic String getAttr(String username, String attrName)
username - a usernameattrName - the name of the attribute to findpublic List<String> getAllAttrs(String username, String attrName)
username - a usernameattrName - the name of the attribute to findpublic List<Map<String,String>> getAttrs(String username, List<String> attrNames)
username - attrNames - - List of attributes to retrieve from search resultspublic boolean testIfInObjectClass(String username, String testSubj)
username - a usernametestSubj - the string to look fortrue if string was found false
otherwisepublic List<String> getRoles(String username)
username - The username that identifies the userpublic List<Map<String,List<String>>> getAllAttrValues(String[] term, String searchString)
term - - array of values to replace on search stringsearchString - - must be of String.format()public void useSystemCred()
Copyright © 2009-2015. All Rights Reserved.