Class LoginModuleRegistry


  • public class LoginModuleRegistry
    extends Object
    Registry of all LoginModule instances to use when authenticating a user accessing the JCR. These LoginModule must be a bridge in the security system between the JCR implementation and Silverpeas and as such they should extend the SilverpeasJCRLoginModule abstract class. By default, the following LoginModules are registered:
    • SilverpeasSimpleJCRLoginModule to take in charge the authentication of a user in Silverpeas by a SimpleCredentials in which the user login and the user password are provided.
    • SilverpeasTokenJCRLoginModule to take in charge the authentication of a user in Silverpeas by a TokenCredentials in which the API token of the user is provided.
    Author:
    mmoquillon
    • Method Detail

      • addLoginModule

        public void addLoginModule​(Class<? extends javax.jcr.Credentials> credentialsType,
                                   Class<? extends SilverpeasJCRLoginModule> module)
        Adds the specified LoginModule class as a processor of any instances of the given credentials type.
        Parameters:
        credentialsType - a concrete type of Credentials.
        module - a SilverpeasJCRLoginModule 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 the LoginModule 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 of Credentials.
        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.