Class SimpleLoginModule
- java.lang.Object
-
- org.apache.jackrabbit.core.security.authentication.AbstractLoginModule
-
- org.apache.jackrabbit.core.security.simple.SimpleLoginModule
-
- All Implemented Interfaces:
LoginModule
public class SimpleLoginModule extends AbstractLoginModule
SimpleLoginModule
...
-
-
Field Summary
-
Fields inherited from class org.apache.jackrabbit.core.security.authentication.AbstractLoginModule
adminId, anonymousId, callbackHandler, credentials, principal, principalProvider, sharedState, subject
-
-
Constructor Summary
Constructors Constructor Description SimpleLoginModule()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
doInit(CallbackHandler callbackHandler, Session session, Map options)
Implementations may set-up their own state.protected Authentication
getAuthentication(Principal principal, Credentials creds)
Retrieve theAuthentication
.protected Principal
getPrincipal(Credentials credentials)
Uses the configuredPrincipalProvider
to retrieve the principal.protected boolean
impersonate(Principal principal, Credentials credentials)
Handles the impersonation of given Credentials.-
Methods inherited from class org.apache.jackrabbit.core.security.authentication.AbstractLoginModule
abort, authenticate, commit, getAdminId, getAnonymousId, getCredentials, getImpersonatorSubject, getPreAuthAttributeName, getPrincipalProvider, getPrincipals, getUserID, initialize, isAnonymous, isImpersonation, isInitialized, isPreAuthenticated, login, logout, setAdminId, setAnonymousId, setPrincipalProvider, supportsCredentials
-
-
-
-
Method Detail
-
doInit
protected void doInit(CallbackHandler callbackHandler, Session session, Map options) throws LoginException
Description copied from class:AbstractLoginModule
Implementations may set-up their own state.- Specified by:
doInit
in classAbstractLoginModule
- Parameters:
callbackHandler
- as passed byLoginContext
session
- to security-workspace of Jackrabbitoptions
- options from LoginModule config- Throws:
LoginException
- in case initialization fails.- See Also:
AbstractLoginModule.doInit(javax.security.auth.callback.CallbackHandler, javax.jcr.Session, java.util.Map)
-
impersonate
protected boolean impersonate(Principal principal, Credentials credentials) throws RepositoryException, LoginException
Description copied from class:AbstractLoginModule
Handles the impersonation of given Credentials.- Specified by:
impersonate
in classAbstractLoginModule
- Parameters:
principal
- Principal to impersonate.credentials
- Credentials used to create the impersonation subject.- Returns:
- false, if there is no User to impersonate, true if impersonation is allowed
- Throws:
RepositoryException
- If another error occurs.LoginException
- If credentials don't allow to impersonate to principal.- See Also:
AbstractLoginModule.impersonate(java.security.Principal, javax.jcr.Credentials)
-
getAuthentication
protected Authentication getAuthentication(Principal principal, Credentials creds) throws RepositoryException
Description copied from class:AbstractLoginModule
Retrieve theAuthentication
.- Specified by:
getAuthentication
in classAbstractLoginModule
- Parameters:
principal
- A principal.creds
- The Credentials used for the login.- Returns:
- Authentication object for the given principal / credentials.
- Throws:
RepositoryException
- If an error occurs.- See Also:
AbstractLoginModule.getAuthentication(java.security.Principal, javax.jcr.Credentials)
-
getPrincipal
protected Principal getPrincipal(Credentials credentials)
Uses the configuredPrincipalProvider
to retrieve the principal. It takes thePrincipalProvider.getPrincipal(String)
for the User-ID resolved byAbstractLoginModule.getUserID(Credentials)
, assuming that User-ID and the corresponding principal name are always identical.- Specified by:
getPrincipal
in classAbstractLoginModule
- Parameters:
credentials
- Credentials for which the principal should be resolved.- Returns:
- principal or
null
if the principal provider does not contain a user-principal with the given userID/principal name. - See Also:
AbstractLoginModule.getPrincipal(Credentials)
-
-