@Transactional(readOnly=true) public class LdapImpl extends AbstractLevel2Service implements ILdap, org.springframework.context.ApplicationContextAware
SecuritySystem
,
Permissions
Modifier and Type | Class and Description |
---|---|
class |
LdapImpl.GroupLoader
Data class which stores the state of the
NewUserGroupBean and
NewUserGroupOwnerBean operations. |
iQuery, iUpdate, metadata, queryFactory, sec
Constructor and Description |
---|
LdapImpl(org.springframework.ldap.core.ContextSource ctx,
org.springframework.ldap.core.LdapOperations ldap,
Roles roles,
LdapConfig config,
RoleProvider roleProvider,
SqlAction sql) |
Modifier and Type | Method and Description |
---|---|
Experimenter |
createUser(java.lang.String username)
Creates an
Experimenter based on the supplied LDAP username. |
Experimenter |
createUser(java.lang.String username,
java.lang.String password)
Creates an
Experimenter based on the supplied LDAP username. |
Experimenter |
createUser(java.lang.String username,
java.lang.String password,
boolean checkPassword)
Creates an
Experimenter based on the supplied LDAP username. |
boolean |
createUserFromLdap(java.lang.String username,
java.lang.String password)
Deprecated.
|
java.util.List<Experimenter> |
discover()
Discovers and lists
Experimenter s who are present
in the remote LDAP server and in the local DB but have the
ldap property set to false . |
java.util.List<ExperimenterGroup> |
discoverGroups()
Discovers and lists
ExperimenterGroup s which are
present in the remote LDAP server and in the local DB but have the
ldap property set to false . |
java.lang.String |
findDN(java.lang.String username)
Searches unique Distinguished Name -
String in LDAP for
Common Name equals username. |
Experimenter |
findExperimenter(java.lang.String username)
Searches Experimenter by unique Distinguished Name -
String in LDAP for Common Name equals username. |
ExperimenterGroup |
findGroup(java.lang.String groupname)
Looks up a specific
ExperimenterGroup in LDAP
using the provided group name. |
java.lang.String |
findGroupDN(java.lang.String groupname)
Looks up the DN for a group.
|
java.lang.Class<? extends ServiceInterface> |
getServiceInterface() |
boolean |
getSetting()
Gets config value from properties.
|
java.util.List<java.lang.Long> |
loadLdapGroups(java.lang.String username,
org.springframework.ldap.core.DistinguishedName dn)
Deprecated.
|
java.lang.String |
lookupLdapAuthExperimenter(java.lang.Long id)
Queries the LDAP server and returns the DN for the specified OMERO user
ID.
|
java.util.List<java.util.Map<java.lang.String,java.lang.Object>> |
lookupLdapAuthExperimenters()
Queries the LDAP server and returns the DN for all OMERO users that have
the
ldap flag enabled. |
java.util.List<Experimenter> |
searchAll()
Searches all
Experimenter list on LDAP for
attribute objectClass = person. |
java.util.List<Experimenter> |
searchByAttribute(java.lang.String dns,
java.lang.String attr,
java.lang.String value)
Searches all
Experimenter in LDAP for specified
attribute |
java.util.List<Experimenter> |
searchByAttributes(java.lang.String dn,
java.lang.String[] attributes,
java.lang.String[] values)
Searches all
Experimenter in LDAP for specified
attributes. |
Experimenter |
searchByDN(java.lang.String dns)
Searches one
Experimenter in LDAP for specified
Distinguished Name - String |
java.util.List<java.lang.String> |
searchDnInGroups(java.lang.String attr,
java.lang.String value)
Searches Distinguished Name -
String in groups |
void |
setApplicationContext(org.springframework.context.ApplicationContext arg0) |
void |
setDN(java.lang.Long experimenterID,
java.lang.String dn)
Deprecated.
|
void |
synchronizeLdapUser(java.lang.String username) |
boolean |
validatePassword(java.lang.String dn,
java.lang.String password)
Validates password for base.
|
getBeanHelper, getExtendedMetadata, getQueryFactory, getSecuritySystem, selfConfigure, setExtendedMetadata, setQueryFactory, setQueryService, setSecuritySystem, setUpdateService
public LdapImpl(org.springframework.ldap.core.ContextSource ctx, org.springframework.ldap.core.LdapOperations ldap, Roles roles, LdapConfig config, RoleProvider roleProvider, SqlAction sql)
public void setApplicationContext(org.springframework.context.ApplicationContext arg0) throws org.springframework.beans.BeansException
setApplicationContext
in interface org.springframework.context.ApplicationContextAware
org.springframework.beans.BeansException
public java.lang.Class<? extends ServiceInterface> getServiceInterface()
getServiceInterface
in interface SelfConfigurableService
public java.util.List<Experimenter> searchAll()
ILdap
Experimenter
list on LDAP for
attribute objectClass = person.public java.util.List<Experimenter> searchByAttribute(java.lang.String dns, java.lang.String attr, java.lang.String value)
ILdap
Experimenter
in LDAP for specified
attributesearchByAttribute
in interface ILdap
dns
- Distinguished Name
base for search. Never null.attr
- Name of attribute. Never null or empty.value
- Expected value of attribute. Never null or empty.public Experimenter searchByDN(java.lang.String dns)
ILdap
Experimenter
in LDAP for specified
Distinguished Name - String
searchByDN
in interface ILdap
dns
- unique Distinguished Name - String
of user,
Never null or empty.public java.lang.String findDN(java.lang.String username)
ILdap
String
in LDAP for
Common Name equals username. Common Name should be unique under the
specified base. If list of cn's contains more then one DN will return
exception.public java.lang.String findGroupDN(java.lang.String groupname)
ILdap
findGroupDN
in interface ILdap
public Experimenter findExperimenter(java.lang.String username)
ILdap
String
in LDAP for Common Name equals username. Common
Name should be unique under the specified base. If list of cn's contains
more then one DN will return exception.findExperimenter
in interface ILdap
username
- Name of the Experimenter equals CommonName.public ExperimenterGroup findGroup(java.lang.String groupname)
ILdap
ExperimenterGroup
in LDAP
using the provided group name. It is expected that the group name will be
unique in the searched LDAP base tree. If more than one group with the
specified name has been found, an exception will be thrown.public java.util.List<java.lang.String> searchDnInGroups(java.lang.String attr, java.lang.String value)
ILdap
String
in groupssearchDnInGroups
in interface ILdap
attr
- Name of member attribute. Never null or empty.value
- User's DN which should be set on value for attribute.
Never null or empty.public java.util.List<Experimenter> searchByAttributes(java.lang.String dn, java.lang.String[] attributes, java.lang.String[] values)
ILdap
Experimenter
in LDAP for specified
attributes. Attributes should be specified in String [] and their values
should be set in equivalent String [].searchByAttributes
in interface ILdap
dn
- DistinguishedName
base for search. Never null.attributes
- Name of attribute. Never null or empty.values
- Expected value of attribute. Never null or empty.@Transactional(readOnly=false) @Deprecated public void setDN(java.lang.Long experimenterID, java.lang.String dn)
ILdap
dn
column in the password
table to the supplied string, for the supplied
Experimenter
ID.public boolean getSetting()
ILdap
getSetting
in interface ILdap
public void synchronizeLdapUser(java.lang.String username)
@Deprecated @Transactional(readOnly=false) public boolean createUserFromLdap(java.lang.String username, java.lang.String password)
Experimenter
based on the supplied LDAP username.
Doesn't validate the user's password and can be only executed by admin
users.username
- The user's LDAP username.password
- The user's LDAP password, not null.@Transactional(readOnly=false) public Experimenter createUser(java.lang.String username)
Experimenter
based on the supplied LDAP username.
Doesn't validate the user's password and can be only executed by admin
users.createUser
in interface ILdap
username
- The user's LDAP username.Experimenter
object.public Experimenter createUser(java.lang.String username, java.lang.String password)
Experimenter
based on the supplied LDAP username.
Enforces user password validation.username
- The user's LDAP username.password
- The user's LDAP password, not null.Experimenter
object.public Experimenter createUser(java.lang.String username, java.lang.String password, boolean checkPassword)
Experimenter
based on the supplied LDAP username.
A boolean flag controls if password checks should be performed.username
- The user's LDAP username.password
- The user's password.checkPassword
- Flag indicating if password check should be performed.Experimenter
object.@Deprecated public java.util.List<java.lang.Long> loadLdapGroups(java.lang.String username, org.springframework.ldap.core.DistinguishedName dn)
public boolean validatePassword(java.lang.String dn, java.lang.String password)
dn
- the user's distinguished namepassword
- the user's passwordpublic java.util.List<java.util.Map<java.lang.String,java.lang.Object>> lookupLdapAuthExperimenters()
ldap
flag enabled.public java.lang.String lookupLdapAuthExperimenter(java.lang.Long id)
ldap
flag enabled.id
- The user ID.public java.util.List<Experimenter> discover()
ILdap
Experimenter
s who are present
in the remote LDAP server and in the local DB but have the
ldap
property set to false
.public java.util.List<ExperimenterGroup> discoverGroups()
ILdap
ExperimenterGroup
s which are
present in the remote LDAP server and in the local DB but have the
ldap
property set to false
.discoverGroups
in interface ILdap
Version: 5.4.4-ice35-b82
Copyright © 2018 The University of Dundee & Open Microscopy Environment. All Rights Reserved.