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 JackrabbitLoginModule
that delegates to a Spring SecurityAuthenticationManager
. Also, adds more checks to the pre-authentication scenario.- Author:
- mlowery
-
-
Field Summary
Fields Modifier and Type Field Description protected static org.springframework.security.authentication.AuthenticationManager
authManager
protected static org.springframework.security.authentication.AuthenticationManager
NULL_AUTHENTICATION_MANAGER
When there's no AuthenticationManager available in PentahoSystem, this one will be returned.
-
Constructor Summary
Constructors Constructor Description SpringSecurityLoginModule()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected 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
getAuthenticationManager()
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 Detail
-
NULL_AUTHENTICATION_MANAGER
protected static final org.springframework.security.authentication.AuthenticationManager NULL_AUTHENTICATION_MANAGER
When 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
-
-
Method Detail
-
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
protected Principal getPrincipal(javax.jcr.Credentials credentials)
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
-
-