public final class DefaultLDAPImpl extends AbstractAuthenticationPluginHelper
Modifier and Type | Field and Description |
---|---|
private static String |
AUTHOR
Plugin author.
|
private Map<String,String> |
conf
Configuration file.
|
private boolean |
configured
Status of the plugin configuration.
|
private static String |
DESCRIPTION
Plugin description.
|
static String |
LDAP_ATTR_FULLNAME
Attributes name in LDAP for fullname.
|
static String |
LDAP_ATTR_MAIL
Attributes name in LDAP for mail.
|
static String |
LDAP_ATTR_USERNAME
Attributes name in LDAP for username.
|
static String |
LDAP_DOI_ADMIN
LDAP username who is the administrator of the DOI server
|
static String |
LDAP_PROJECT
LDAP project
|
static String |
LDAP_PWD
LDAP pwd
|
static String |
LDAP_SEARCH_GROUP
Specifies the filter expression to get the group.
|
static String |
LDAP_SEARCH_USER
Specifies the filter expression to get the users.
|
static String |
LDAP_URL
LDAP url
|
static String |
LDAP_USER
LDAP user
|
private static String |
LICENSE
Plugin license.
|
private static org.apache.logging.log4j.Logger |
LOGGER
Logger.
|
private String |
NAME
Plugin name.
|
private static String |
OWNER
Plugin owner.
|
private static String |
VERSION
Plugin version.
|
Constructor and Description |
---|
DefaultLDAPImpl() |
Modifier and Type | Method and Description |
---|---|
boolean |
authenticateUser(String login,
String password)
Authenticates an user via the authentication service.
|
List<AuthSystemUser> |
getAllDOIProjectMembers(InitialLdapContext context)
Search on LDAP all users which are in the group Consts.LDAP_PROJECT.
|
String |
getAuthor()
Returns the author of the plugin.
|
private InitialLdapContext |
getContext()
Init LDAP context.
|
String |
getDescription()
Returns the description of the plugin
|
String |
getDOIAdmin()
Returns the user from the authentication access, which will be the
administrator of DOI server.
|
List<AuthSystemUser> |
getDOIProjectMembers()
Returns the authentication members.
|
private List<AuthSystemUser> |
getLdapUsers(DirContext context,
String gidNumber)
Search on LDAP all users which are in the group Consts.LDAP_PROJECT in a
LDAP group
|
String |
getLicense()
Returns the license of the plugin.
|
String |
getName()
Returns the name of the plugin.
|
String |
getOwner()
Returns the owner of the plugin.
|
String |
getVersion()
Returns the version of the plugin.
|
void |
initConnection()
Inits the connection
|
boolean |
isConfigured()
Checks if the plugin is already configured
|
private boolean |
isLdapConfigured()
Returns true when the LDAP context is well configured.
|
static boolean |
isPassword(String key)
Checks if the keyword is a password.
|
void |
release()
Release the plugin.
|
void |
setConfiguration(Object configuration)
Sets the configuration.
|
StringBuilder |
validate()
Validates the parameters in the configuration file.
|
public static final String LDAP_URL
public static final String LDAP_USER
public static final String LDAP_PWD
public static final String LDAP_PROJECT
public static final String LDAP_DOI_ADMIN
public static final String LDAP_SEARCH_GROUP
public static final String LDAP_SEARCH_USER
public static final String LDAP_ATTR_USERNAME
public static final String LDAP_ATTR_MAIL
public static final String LDAP_ATTR_FULLNAME
private static final org.apache.logging.log4j.Logger LOGGER
private static final String DESCRIPTION
private static final String VERSION
private static final String OWNER
private static final String AUTHOR
private static final String LICENSE
private final String NAME
private boolean configured
public void setConfiguration(Object configuration)
configuration
- configuration parameterspublic void initConnection() throws DoiRuntimeException
DoiRuntimeException
- When an connection error happenspublic List<AuthSystemUser> getDOIProjectMembers() throws AuthenticationAccessException
AuthenticationAccessException
- When a problem occursprivate boolean isLdapConfigured()
private InitialLdapContext getContext() throws NamingException
NamingException
- Unable to connect to Ldappublic boolean authenticateUser(String login, String password)
login
- loginpassword
- passwordpublic List<AuthSystemUser> getAllDOIProjectMembers(InitialLdapContext context) throws AuthenticationAccessException
context
- contextAuthenticationAccessException
- Exceptionprivate List<AuthSystemUser> getLdapUsers(DirContext context, String gidNumber) throws NamingException
context
- contextgidNumber
- LDAP group IDNamingException
- Exceptionpublic String getName()
public String getDescription()
public String getVersion()
public String getAuthor()
public String getOwner()
public String getLicense()
public String getDOIAdmin()
public StringBuilder validate()
public static boolean isPassword(String key)
key
- keyword to checkpublic void release()
public boolean isConfigured()
Copyright © 2017–2020 CNES. All rights reserved.