org.apache.jackrabbit.core.security.simple
Class SimpleLoginModule

java.lang.Object
  extended by org.apache.jackrabbit.core.security.authentication.AbstractLoginModule
      extended by org.apache.jackrabbit.core.security.simple.SimpleLoginModule
All Implemented Interfaces:
LoginModule
Direct Known Subclasses:
SimpleLoginModule

public class SimpleLoginModule
extends AbstractLoginModule

SimpleLoginModule...


Field Summary
 
Fields inherited from class org.apache.jackrabbit.core.security.authentication.AbstractLoginModule
adminId, anonymousId, credentials, principal, principalProvider, subject
 
Constructor Summary
SimpleLoginModule()
           
 
Method Summary
protected  void doInit(CallbackHandler callbackHandler, Session session, Map options)
          Implementations may set-up their own state.
protected  Authentication getAuthentication(Principal principal, Credentials creds)
           
protected  Principal getPrincipal(Credentials credentials)
          Uses the configured PrincipalProvider 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, getPrincipalProvider, getPrincipals, getUserID, initialize, isAnonymous, isImpersonation, isInitialized, login, logout, setAdminId, setAnonymousId, setPrincipalProvider
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleLoginModule

public SimpleLoginModule()
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. E. g. a DataSource if it is authorized against an external System

Specified by:
doInit in class AbstractLoginModule
Parameters:
callbackHandler - as passed by LoginContext
session - to security-workspace of Jackrabbit
options - options from Logini config
Throws:
LoginException - in case initializeaiton failes

impersonate

protected boolean impersonate(Principal principal,
                              Credentials credentials)
                       throws RepositoryException,
                              LoginException
Description copied from class: AbstractLoginModule
Handles the impersonation of given Credentials.

Current implementation takes User for the given Principal and delegates the check to Impersonation.allows(javax.security.auth.Subject) }

Specified by:
impersonate in class AbstractLoginModule
Returns:
false, if there is no User to impersonate, true if impersonation is allowed
Throws:
RepositoryException
FailedLoginException - if credentials don't allow to impersonate to principal
LoginException

getAuthentication

protected Authentication getAuthentication(Principal principal,
                                           Credentials creds)
                                    throws RepositoryException
Specified by:
getAuthentication in class AbstractLoginModule
Returns:
Throws:
RepositoryException

getPrincipal

protected Principal getPrincipal(Credentials credentials)
Uses the configured PrincipalProvider to retrieve the principal. It takes the PrincipalProvider.getPrincipal(String) for the User-ID resolved by AbstractLoginModule.getUserID(Credentials), assuming that User-ID and the corresponding principal name are always identical.

Specified by:
getPrincipal in class AbstractLoginModule
Parameters:
credentials -
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)


Copyright © 2004-2008 The Apache Software Foundation. All Rights Reserved.