Modifier and Type | Field and Description |
---|---|
static String |
LDAP_DOMAIN
The domain for the LDAP authentication
|
static String |
LDAP_GROUP_BASE_DN
The base-DN for LDAP-groups
|
static String |
LDAP_HOST
The LDAP host
|
static String |
LDAP_ID_ATTRIBUTE
The name of the LDAP-attribute containing the user-id used for authentication
|
static String |
LDAP_PASSWORD
Password of the LDAP service-user
|
static String |
LDAP_USER
The name of the LDAP service-user
|
static String |
LDAP_USER_BASE_DN
The base-DN for LDAP-users
|
Constructor and Description |
---|
LdapService() |
Modifier and Type | Method and Description |
---|---|
protected DirContext |
getContext(Properties env) |
protected List<String> |
getMemberNames(Attributes attributes) |
List<SubjectImpl> |
getMembersOfGroup(Properties siteProperties,
String groupName) |
List<String> |
loginGroup(Site site,
String username,
char[] password,
SubjectImpl subject,
List<String> groupNames)
Tries to login the user as a member of at least one of the given groups.
|
boolean |
loginUser(Site site,
String username,
char[] password)
Tries to login the user with the given username and password.
|
public static final String LDAP_DOMAIN
public static final String LDAP_PASSWORD
public static final String LDAP_USER
public static final String LDAP_GROUP_BASE_DN
public static final String LDAP_USER_BASE_DN
public static final String LDAP_HOST
public static final String LDAP_ID_ATTRIBUTE
public boolean loginUser(Site site, String username, char[] password)
site
- the Site
the user wants to login atusername
- the name of the user, without base-DN (this is set in the site-property "ldapUserBaseDn")password
- the password of the usertrue
if the user could be successfully logged in, false
otherwisepublic List<String> loginGroup(Site site, String username, char[] password, SubjectImpl subject, List<String> groupNames)
site
- the Site
the user wants to login atusername
- the name of the userpassword
- the password of the usersubject
- a SubjectImpl
where the name and real name are set, in case the user belongs to at least one
of the given groupsgroupNames
- a list containing the names of all groups to check group membership for (without base-DN, this is set
in the site-property "ldapGroupBaseDn")public List<SubjectImpl> getMembersOfGroup(Properties siteProperties, String groupName)
protected DirContext getContext(Properties env) throws NamingException
NamingException
protected List<String> getMemberNames(Attributes attributes) throws NamingException
NamingException
Copyright © 2011–2017 aiticon GmbH. All rights reserved.