Class SilverpeasTokenJCRLoginModule

  • All Implemented Interfaces:
    LoginModule

    public class SilverpeasTokenJCRLoginModule
    extends SilverpeasJCRLoginModule
    A login module to authenticate the users who access the JCR repository used by Silverpeas. This login module accepts only TokenCredentials carrying the API token of the user.

    The login module verifies the token by asking to Silverpeas the user having such a token. If no such a user exists, then the authentication is considered as a failure.

    Author:
    mmoquillon
    • Constructor Detail

      • SilverpeasTokenJCRLoginModule

        public SilverpeasTokenJCRLoginModule()
    • Method Detail

      • getSupportedCredentials

        @Nonnull
        protected Set<Class> getSupportedCredentials()
        Specified by:
        getSupportedCredentials in class org.apache.jackrabbit.oak.spi.security.authentication.AbstractLoginModule
      • authenticateUser

        protected User authenticateUser​(javax.jcr.Credentials credentials)
                                 throws LoginException
        Description copied from class: SilverpeasJCRLoginModule
        Authenticates the user behind the specified credentials.
        Specified by:
        authenticateUser in class SilverpeasJCRLoginModule
        Parameters:
        credentials - the credentials of a user in Silverpeas.
        Returns:
        the user identified by the given credentials if and only if the authentication succeeds.
        Throws:
        LoginException - if the authentication of the user fails.
      • getAccessContext

        @Nonnull
        protected AccessContext getAccessContext​(javax.jcr.Credentials credentials)
        Description copied from class: SilverpeasJCRLoginModule
        Gets the peculiar context under which the user behind the specified credentials accesses the JCR. The context has to be fetched through some attributes in the specified credentials. By default, this method returns AccessContext.EMPTY meaning no peculiar access context.
        Overrides:
        getAccessContext in class SilverpeasJCRLoginModule
        Parameters:
        credentials - the credentials of the user in which some attributes have been set in order to define the current access context of the user.
        Returns:
        the current access context of the user. By default, no peculiar context.