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

    Fields
    Modifier and Type
    Field
    Description
    protected 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
    Constructor
    Description
     
  • Method Summary

    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 a UsernamePasswordAuthenticationToken from the given principal and credentials and passes to Spring Security AuthenticationManager.
    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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • 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
  • 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 class org.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 a UsernamePasswordAuthenticationToken from the given principal and credentials and passes to Spring Security AuthenticationManager.
      Specified by:
      getAuthentication in class org.apache.jackrabbit.core.security.authentication.AbstractLoginModule
      Throws:
      javax.jcr.RepositoryException
    • getPrincipal

      protected Principal getPrincipal(javax.jcr.Credentials credentials)

      Implementation copied from SimpleLoginModule. Delegates to a PrincipalProvider.

      Specified by:
      getPrincipal in class org.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 class org.apache.jackrabbit.core.security.authentication.AbstractLoginModule
      Throws:
      javax.jcr.RepositoryException
      LoginException
    • isPreAuthenticated

      protected boolean isPreAuthenticated(javax.jcr.Credentials creds)
      Overrides:
      isPreAuthenticated in class org.apache.jackrabbit.core.security.authentication.AbstractLoginModule