Class AADUserDirectory
- java.lang.Object
-
- org.ametys.runtime.plugin.component.AbstractLogEnabled
-
- org.ametys.plugins.core.impl.user.directory.AbstractCachingUserDirectory
-
- org.ametys.plugins.extrausermgt.users.aad.AADUserDirectory
-
- All Implemented Interfaces:
UserDirectory
,Cacheable
,LogEnabled
,Disposable
,Serviceable
public class AADUserDirectory extends AbstractCachingUserDirectory
UserDirectory
listing users in Azure Active Directory.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.ametys.core.util.Cacheable
Cacheable.SingleCacheConfiguration
-
-
Constructor Summary
Constructors Constructor Description AADUserDirectory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
checkCredentials(String login, String password)
Authenticate a user with its credentialsprotected String
getCacheTypeLabel()
Returns a String identifying the type of this directory, used in the cache screen in _admin, such as 'SQL' or 'LDAP'.User
getUser(String login)
Get a particular user by his login.User
getUserByEmail(String email)
Get a particular user by his email (search should be case insensitive).Collection<User>
getUsers()
Get the list of all users of one directory.List<User>
getUsers(int count, int offset, Map<String,Object> parameters)
Get a list of users from a directory given the parametersvoid
init(String id, String udModelId, Map<String,Object> paramValues, String label)
Initialize the user's directory with given parameters' values.-
Methods inherited from class org.ametys.plugins.core.impl.user.directory.AbstractCachingUserDirectory
dispose, getCacheByLogin, getCacheByMail, getCacheManager, getId, getLabel, getManagedCaches, getParameterValues, getPopulationId, getUserDirectoryModelId, service, setPopulationId
-
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.ametys.core.util.Cacheable
createCaches, getCache, hasComputableSize, isCachingEnabled, removeCaches
-
Methods inherited from interface org.ametys.core.user.directory.UserDirectory
isCaseSensitive
-
-
-
-
Constructor Detail
-
AADUserDirectory
public AADUserDirectory()
-
-
Method Detail
-
init
public void init(String id, String udModelId, Map<String,Object> paramValues, String label)
Description copied from interface:UserDirectory
Initialize the user's directory with given parameters' values.- Specified by:
init
in interfaceUserDirectory
- Overrides:
init
in classAbstractCachingUserDirectory
- Parameters:
id
- The non-null and non-empty unique identifierudModelId
- The id of user directory extension pointparamValues
- The parameters' valueslabel
- The optional label
-
getCacheTypeLabel
protected String getCacheTypeLabel()
Description copied from class:AbstractCachingUserDirectory
Returns a String identifying the type of this directory, used in the cache screen in _admin, such as 'SQL' or 'LDAP'.- Specified by:
getCacheTypeLabel
in classAbstractCachingUserDirectory
- Returns:
- this directory's type
-
getUsers
public Collection<User> getUsers()
Description copied from interface:UserDirectory
Get the list of all users of one directory.- Returns:
- list of users as Collection of
User
s, empty if a problem occurs.
-
getUsers
public List<User> getUsers(int count, int offset, Map<String,Object> parameters)
Description copied from interface:UserDirectory
Get a list of users from a directory given the parameters- Parameters:
count
- The limit of users to retrieveoffset
- The number of result to ignore before starting to collect users.parameters
- A map of additional parameters, see implementation.- Returns:
- The list of retrieved
User
-
getUser
public User getUser(String login)
Description copied from interface:UserDirectory
Get a particular user by his login.- Parameters:
login
- Login of the user to get. Cannot be null.- Returns:
- User's information as a
User
instance or null if the user login does not exist.
-
getUserByEmail
public User getUserByEmail(String email) throws NotUniqueUserException
Description copied from interface:UserDirectory
Get a particular user by his email (search should be case insensitive).- Parameters:
email
- Email of the user to get. Cannot be null.- Returns:
- User's information as a
User
instance or null if the user email does not exist. - Throws:
NotUniqueUserException
- If many users match this email
-
checkCredentials
public boolean checkCredentials(String login, String password)
Description copied from interface:UserDirectory
Authenticate a user with its credentials- Parameters:
login
- The login to check. Cannot be null.password
- The password to check.- Returns:
- true if the user is authenticated, false otherwise.
-
-