org.apache.jackrabbit.core.security.authentication
Class DefaultLoginModule
java.lang.Object
org.apache.jackrabbit.core.security.authentication.AbstractLoginModule
org.apache.jackrabbit.core.security.authentication.DefaultLoginModule
- All Implemented Interfaces:
- javax.security.auth.spi.LoginModule
public class DefaultLoginModule
- extends AbstractLoginModule
The DefaultLoginModule authenticates Credentials related to
a User of the Repository
In any other case it is marked to be ignored.
This Module can deal only with SimpleCredentials since it
uses by default the SimpleCredentialsAuthentication. Impersonation is
delegated to the User's Impersonation object
- See Also:
AbstractLoginModule
|
Method Summary |
protected void |
doInit(javax.security.auth.callback.CallbackHandler callbackHandler,
javax.jcr.Session session,
java.util.Map options)
Retrieves the user manager from the specified session. |
protected Authentication |
getAuthentication(java.security.Principal principal,
javax.jcr.Credentials creds)
|
protected java.security.Principal |
getPrincipal(javax.jcr.Credentials credentials)
Resolves the userID from the given credentials and obtains the
principal from the User object associated with the given userID. |
protected boolean |
impersonate(java.security.Principal principal,
javax.jcr.Credentials credentials)
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) |
| 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 |
DefaultLoginModule
public DefaultLoginModule()
doInit
protected void doInit(javax.security.auth.callback.CallbackHandler callbackHandler,
javax.jcr.Session session,
java.util.Map options)
throws javax.security.auth.login.LoginException
- Retrieves the user manager from the specified session. If this fails
this login modules initialization must fail.
- Specified by:
doInit in class AbstractLoginModule
- Parameters:
callbackHandler - as passed by LoginContextsession - to security-workspace of Jackrabbitoptions - options from Logini config
- Throws:
javax.security.auth.login.LoginException - in case initializeaiton failes- See Also:
AbstractLoginModule.doInit(CallbackHandler, Session, Map)
getPrincipal
protected java.security.Principal getPrincipal(javax.jcr.Credentials credentials)
- Resolves the userID from the given credentials and obtains the
principal from the User object associated with the given userID.
If the the userID cannot be resolved to a User or if obtaining the
principal fail,
null is returned.
- Specified by:
getPrincipal in class AbstractLoginModule
- Parameters:
credentials -
- Returns:
- a user principal or
null. - See Also:
AbstractLoginModule.getPrincipal(Credentials)
getAuthentication
protected Authentication getAuthentication(java.security.Principal principal,
javax.jcr.Credentials creds)
throws javax.jcr.RepositoryException
- Specified by:
getAuthentication in class AbstractLoginModule
- Returns:
-
- Throws:
javax.jcr.RepositoryException- See Also:
AbstractLoginModule.getAuthentication(Principal, Credentials)
impersonate
protected boolean impersonate(java.security.Principal principal,
javax.jcr.Credentials credentials)
throws javax.jcr.RepositoryException,
javax.security.auth.login.FailedLoginException
- 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
- Parameters:
principal - credentials -
- Returns:
- false, if there is no User to impersonate,
true if impersonation is allowed
- Throws:
javax.jcr.RepositoryException
javax.security.auth.login.FailedLoginException - if credentials don't allow to impersonate to principal- See Also:
AbstractLoginModule.impersonate(Principal, Credentials)
Copyright © 2004-2011 Apache Software Foundation. All Rights Reserved.