Package org.silverpeas.core.jcr.security
Class LoginModuleRegistry
- java.lang.Object
-
- org.silverpeas.core.jcr.security.LoginModuleRegistry
-
public class LoginModuleRegistry extends Object
Registry of allLoginModule
instances to use when authenticating a user accessing the JCR. TheseLoginModule
must be a bridge in the security system between the JCR implementation and Silverpeas and as such they should extend theSilverpeasJCRLoginModule
abstract class. By default, the followingLoginModule
s are registered:SilverpeasSimpleJCRLoginModule
to take in charge the authentication of a user in Silverpeas by aSimpleCredentials
in which the user login and the user password are provided.SilverpeasTokenJCRLoginModule
to take in charge the authentication of a user in Silverpeas by aTokenCredentials
in which the API token of the user is provided.
- Author:
- mmoquillon
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addLoginModule(Class<? extends javax.jcr.Credentials> credentialsType, Class<? extends SilverpeasJCRLoginModule> module)
Adds the specifiedLoginModule
class as a processor of any instances of the given credentials type.static LoginModuleRegistry
getInstance()
Gets an instance of the registry.Set<SilverpeasJCRLoginModule>
getLoginModule(Class<? extends javax.jcr.Credentials> credentialsType)
Gets all theLoginModule
objects that support the specified type of credentials.
-
-
-
Method Detail
-
getInstance
public static LoginModuleRegistry getInstance()
Gets an instance of the registry.- Returns:
- a
LoginModuleRegistry
object.
-
addLoginModule
public void addLoginModule(Class<? extends javax.jcr.Credentials> credentialsType, Class<? extends SilverpeasJCRLoginModule> module)
Adds the specifiedLoginModule
class as a processor of any instances of the given credentials type.- Parameters:
credentialsType
- a concrete type ofCredentials
.module
- aSilverpeasJCRLoginModule
class that will be instantiated on demand to perform an authentication operation.
-
getLoginModule
public Set<SilverpeasJCRLoginModule> getLoginModule(Class<? extends javax.jcr.Credentials> credentialsType)
Gets all theLoginModule
objects that support the specified type of credentials. The modules lifecycle is thread-scoped, meaning they are instantiated per thread, then they are disposed once the thread terminated.- Parameters:
credentialsType
- a concrete type ofCredentials
.- Returns:
- a set of
LoginModule
objects that can process the specified type of credentials or an empty list if no one can take in charge this type of credentials.
-
-