Package org.silverpeas.core.jcr.security
Class SilverpeasTokenJCRLoginModule
- java.lang.Object
-
- org.apache.jackrabbit.oak.spi.security.authentication.AbstractLoginModule
-
- org.silverpeas.core.jcr.security.SilverpeasJCRLoginModule
-
- org.silverpeas.core.jcr.security.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 onlyTokenCredentials
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 Summary
Constructors Constructor Description SilverpeasTokenJCRLoginModule()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected User
authenticateUser(javax.jcr.Credentials credentials)
Authenticates the user behind the specified credentials.protected AccessContext
getAccessContext(javax.jcr.Credentials credentials)
Gets the peculiar context under which the user behind the specified credentials accesses the JCR.protected Set<Class>
getSupportedCredentials()
-
Methods inherited from class org.silverpeas.core.jcr.security.SilverpeasJCRLoginModule
clearState, commit, getAllCredentials, getAllPrincipals, initialize, isInitialized, login, logout
-
Methods inherited from class org.apache.jackrabbit.oak.spi.security.authentication.AbstractLoginModule
abort, closeSystemSession, getCredentials, getLoginModuleMonitor, getPrincipalProvider, getPrincipals, getPrincipals, getRoot, getSecurityProvider, getSharedCredentials, getSharedLoginName, getSharedPreAuthLogin, getUserManager, getWhiteboard, logout, onError, setAuthInfo
-
-
-
-
Method Detail
-
getSupportedCredentials
@Nonnull protected Set<Class> getSupportedCredentials()
- Specified by:
getSupportedCredentials
in classorg.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 classSilverpeasJCRLoginModule
- 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 returnsAccessContext.EMPTY
meaning no peculiar access context.- Overrides:
getAccessContext
in classSilverpeasJCRLoginModule
- 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.
-
-