|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.jackrabbit.core.security.authentication.AbstractLoginModule
org.apache.jackrabbit.core.security.authentication.DefaultLoginModule
public class DefaultLoginModule
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 with the following credentials
SimpleCredentials -> handled by SimpleCredentialsAuthentication.TokenCredentials -> handled by TokenBasedAuthentication.User's
Impersonation object.
AbstractLoginModule| Field Summary | |
|---|---|
protected org.apache.jackrabbit.api.security.user.User |
user
The user object retrieved during the authentication process. |
| Fields inherited from class org.apache.jackrabbit.core.security.authentication.AbstractLoginModule |
|---|
adminId, anonymousId, callbackHandler, credentials, principal, principalProvider, sharedState, subject |
| Constructor Summary | |
|---|---|
DefaultLoginModule()
|
|
| Method Summary | |
|---|---|
boolean |
commit()
Method to commit the authentication process (phase 2). |
protected void |
doInit(CallbackHandler callbackHandler,
Session session,
Map options)
Retrieves the user manager from the specified session. |
protected Authentication |
getAuthentication(Principal principal,
Credentials creds)
Retrieve the Authentication. |
protected Principal |
getPrincipal(Credentials credentials)
Resolves the userID from the given credentials and obtains the principal from the User object associated with the given userID. |
long |
getTokenExpiration()
|
protected String |
getUserID(Credentials credentials)
Method supports tries to acquire a UserID in the following order: If passed credentials are GuestCredentials the anonymous user id
is returned.
Try to access it from the Credentials via SimpleCredentials.getUserID()
Ask CallbackHandler for User-ID with use of NameCallback.
Test if the 'sharedState' contains a login name.
Fallback: return the anonymous UserID.
|
protected boolean |
impersonate(Principal principal,
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) |
boolean |
isDisableTokenAuth()
Return a flag indicating if token based authentication is disabled. |
void |
setDisableTokenAuth(boolean disableTokenAuth)
Set a flag indicating if token based authentication is disabled. |
void |
setTokenExpiration(long tokenExpiration)
|
protected boolean |
supportsCredentials(Credentials creds)
Return a flag indicating whether the credentials are supported by this login module. |
| Methods inherited from class org.apache.jackrabbit.core.security.authentication.AbstractLoginModule |
|---|
abort, authenticate, getAdminId, getAnonymousId, getCredentials, getImpersonatorSubject, getPreAuthAttributeName, getPrincipalProvider, getPrincipals, initialize, isAnonymous, isImpersonation, isInitialized, isPreAuthenticated, login, logout, setAdminId, setAnonymousId, setPrincipalProvider |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected org.apache.jackrabbit.api.security.user.User user
| Constructor Detail |
|---|
public DefaultLoginModule()
| Method Detail |
|---|
public boolean commit()
throws LoginException
AbstractLoginModulelogin method),
then this method associates relevant Principals and Credentials with the
Subject located in the LoginModule. If this
LoginModule's own authentication attempted failed, then this method
removes/destroys any state that was originally saved.
The login is considered as succeeded if there is a principal set.
The implementation stores the principal associated to the UserID and all
the Groups it is member of with the Subject and in addition adds an
instance of (#link SimpleCredentials} to the Subject's public credentials.
commit in interface LoginModulecommit in class AbstractLoginModuleLoginModule should be ignored.
LoginException - if the commit failsLoginModule.commit()
protected void doInit(CallbackHandler callbackHandler,
Session session,
Map options)
throws LoginException
doInit in class AbstractLoginModulecallbackHandler - as passed by LoginContextsession - to security-workspace of Jackrabbitoptions - options from LoginModule config
LoginException - in case initialization fails.AbstractLoginModule.doInit(CallbackHandler, Session, Map)protected Principal getPrincipal(Credentials credentials)
null is returned.
getPrincipal in class AbstractLoginModulecredentials - Credentials to retrieve the principal for.
null.AbstractLoginModule.getPrincipal(Credentials)protected boolean supportsCredentials(Credentials creds)
AbstractLoginModuleSimpleCredentials and GuestCredentials.
supportsCredentials in class AbstractLoginModulecreds - credentials
true if the credentials are supported;
false otherwiseAbstractLoginModule.supportsCredentials(javax.jcr.Credentials)protected String getUserID(Credentials credentials)
AbstractLoginModuleGuestCredentials the anonymous user id
is returned.Credentials via SimpleCredentials.getUserID()NameCallback.
getUserID in class AbstractLoginModulecredentials - which, may contain a User-ID
AbstractLoginModule.getUserID(javax.jcr.Credentials)
protected Authentication getAuthentication(Principal principal,
Credentials creds)
throws RepositoryException
AbstractLoginModuleAuthentication.
getAuthentication in class AbstractLoginModuleprincipal - A principal.creds - The Credentials used for the login.
RepositoryException - If an error occurs.AbstractLoginModule.getAuthentication(Principal, Credentials)
protected boolean impersonate(Principal principal,
Credentials credentials)
throws RepositoryException,
FailedLoginException
User for the given Principal and
delegates the check to
Impersonation.allows(javax.security.auth.Subject)
impersonate in class AbstractLoginModuleprincipal - Principal to impersonate.credentials - Credentials used to create the impersonation subject.
RepositoryException
FailedLoginException - if credentials don't allow to impersonate to principalAbstractLoginModule.impersonate(Principal, Credentials)public boolean isDisableTokenAuth()
true if token based authentication is disabled;
false otherwise.public void setDisableTokenAuth(boolean disableTokenAuth)
disableTokenAuth - true to disable token based
authentication; false otherwisepublic long getTokenExpiration()
public void setTokenExpiration(long tokenExpiration)
tokenExpiration - Sets the configured expiration time (in milliseconds)
of login tokens.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||