Class SpringSecurityLoginModule
java.lang.Object
org.apache.jackrabbit.core.security.authentication.AbstractLoginModule
org.pentaho.platform.repository2.unified.jcr.jackrabbit.security.SpringSecurityLoginModule
- All Implemented Interfaces:
LoginModule
public class SpringSecurityLoginModule
extends org.apache.jackrabbit.core.security.authentication.AbstractLoginModule
A Jackrabbit
LoginModule
that delegates to a Spring Security AuthenticationManager
. Also, adds
more checks to the pre-authentication scenario.- Author:
- mlowery
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static org.springframework.security.authentication.AuthenticationManager
protected static final org.springframework.security.authentication.AuthenticationManager
When there's no AuthenticationManager available in PentahoSystem, this one will be returned.Fields inherited from class org.apache.jackrabbit.core.security.authentication.AbstractLoginModule
adminId, anonymousId, callbackHandler, credentials, principal, principalProvider, sharedState, subject
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
doInit
(CallbackHandler callbackHandler, javax.jcr.Session session, Map options) protected org.apache.jackrabbit.core.security.authentication.Authentication
getAuthentication
(Principal principal, javax.jcr.Credentials credentials) Creates aUsernamePasswordAuthenticationToken
from the givenprincipal
andcredentials
and passes to Spring SecurityAuthenticationManager
.protected org.springframework.security.authentication.AuthenticationManager
protected Principal
getPrincipal
(javax.jcr.Credentials credentials) protected boolean
impersonate
(Principal principal, javax.jcr.Credentials credentials) protected boolean
isPreAuthenticated
(javax.jcr.Credentials creds) 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, login, logout, setAdminId, setAnonymousId, setPrincipalProvider, supportsCredentials
-
Field Details
-
NULL_AUTHENTICATION_MANAGER
protected static final org.springframework.security.authentication.AuthenticationManager NULL_AUTHENTICATION_MANAGERWhen there's no AuthenticationManager available in PentahoSystem, this one will be returned. It's sole purpose is to throw an Exception whenever an Authentication attempt is made so a NPE doesn't occur. -
authManager
protected static org.springframework.security.authentication.AuthenticationManager authManager
-
-
Constructor Details
-
SpringSecurityLoginModule
public SpringSecurityLoginModule()
-
-
Method Details
-
doInit
protected void doInit(CallbackHandler callbackHandler, javax.jcr.Session session, Map options) throws LoginException - Specified by:
doInit
in classorg.apache.jackrabbit.core.security.authentication.AbstractLoginModule
- Throws:
LoginException
-
getAuthenticationManager
protected org.springframework.security.authentication.AuthenticationManager getAuthenticationManager() -
getAuthentication
protected org.apache.jackrabbit.core.security.authentication.Authentication getAuthentication(Principal principal, javax.jcr.Credentials credentials) throws javax.jcr.RepositoryException Creates aUsernamePasswordAuthenticationToken
from the givenprincipal
andcredentials
and passes to Spring SecurityAuthenticationManager
.- Specified by:
getAuthentication
in classorg.apache.jackrabbit.core.security.authentication.AbstractLoginModule
- Throws:
javax.jcr.RepositoryException
-
getPrincipal
Implementation copied from
SimpleLoginModule
. Delegates to aPrincipalProvider
.- Specified by:
getPrincipal
in classorg.apache.jackrabbit.core.security.authentication.AbstractLoginModule
-
impersonate
protected boolean impersonate(Principal principal, javax.jcr.Credentials credentials) throws javax.jcr.RepositoryException, LoginException Not implemented.
- Specified by:
impersonate
in classorg.apache.jackrabbit.core.security.authentication.AbstractLoginModule
- Throws:
javax.jcr.RepositoryException
LoginException
-
isPreAuthenticated
protected boolean isPreAuthenticated(javax.jcr.Credentials creds) - Overrides:
isPreAuthenticated
in classorg.apache.jackrabbit.core.security.authentication.AbstractLoginModule
-