Top Description Inners Fields Constructors Methods
org.mortbay.jetty.plus.jaas.spi

public abstract Class AbstractLoginModule

extends Object
implements LoginModule
Class Inheritance
All Implemented Interfaces
javax.security.auth.spi.LoginModule
Known Direct Subclasses
org.mortbay.jetty.plus.jaas.spi.LdapLoginModule, org.mortbay.jetty.plus.jaas.spi.PropertyFileLoginModule, org.mortbay.jetty.plus.jaas.spi.AbstractDatabaseLoginModule
Imports
java.io.IOException, java.security.Principal, java.util.ArrayList, .Iterator, .List, .Map, javax.security.auth.Subject, javax.security.auth.callback.Callback, .CallbackHandler, .NameCallback, .UnsupportedCallbackException, javax.security.auth.login.LoginException, javax.security.auth.spi.LoginModule, org.mortbay.jetty.plus.jaas.JAASPrincipal, .JAASRole, org.mortbay.jetty.plus.jaas.callback.ObjectCallback

AbstractLoginModule Abstract base class for all LoginModules. Subclasses should just need to implement getUserInfo method.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public class

Field Summary

Modifier and TypeField and Description
private boolean
private CallbackHandler
private boolean
private AbstractLoginModule.JAASUserInfo
private Subject

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public boolean
abort()

Implements javax.security.auth.spi.LoginModule.abort.

Method to abort the authentication process (phase 2).
public boolean
commit()

Implements javax.security.auth.spi.LoginModule.commit.

Method to commit the authentication process (phase 2).
public Callback[]
public CallbackHandler
public AbstractLoginModule.JAASUserInfo
public Subject
public abstract UserInfo
getUserInfo(String username)

public void
initialize(Subject subject, CallbackHandler callbackHandler, Map<K, V> sharedState, Map<K, V> options)

Implements javax.security.auth.spi.LoginModule.initialize.

Initialize this LoginModule.
public boolean
public boolean
public boolean
login()

Implements javax.security.auth.spi.LoginModule.login.

Method to authenticate a Subject (phase 1).
public boolean
logout()

Implements javax.security.auth.spi.LoginModule.logout.

Method which logs out a Subject.
public void
setAuthenticated(boolean authState)

public void
public void
setCommitted(boolean commitState)

public void
public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

authStateback to summary
private boolean authState
callbackHandlerback to summary
private CallbackHandler callbackHandler
commitStateback to summary
private boolean commitState
currentUserback to summary
private AbstractLoginModule.JAASUserInfo currentUser
subjectback to summary
private Subject subject

Constructor Detail

AbstractLoginModuleback to summary
public AbstractLoginModule()

Method Detail

abortback to summary
public boolean abort() throws LoginException

Implements javax.security.auth.spi.LoginModule.abort.

Doc from javax.security.auth.spi.LoginModule.abort.

Method to abort the authentication process (phase 2).

This method is called if the LoginContext's overall authentication failed. (the relevant REQUIRED, REQUISITE, SUFFICIENT and OPTIONAL LoginModules did not succeed).

If this LoginModule's own authentication attempt succeeded (checked by retrieving the private state saved by the login method), then this method cleans up any state that was originally saved.

Returns:boolean

true if this method succeeded, or false if this LoginModule should be ignored.

Exceptions
LoginException:
if the abort fails
See Also
javax.security.auth.spi.LoginModule#abort()
commitback to summary
public boolean commit() throws LoginException

Implements javax.security.auth.spi.LoginModule.commit.

Doc from javax.security.auth.spi.LoginModule.commit.

Method to commit the authentication process (phase 2).

This method is called if the LoginContext's overall authentication succeeded (the relevant REQUIRED, REQUISITE, SUFFICIENT and OPTIONAL LoginModules succeeded).

If this LoginModule's own authentication attempt succeeded (checked by retrieving the private state saved by the login 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.

Exceptions
LoginException:
if the commit fails
See Also
javax.security.auth.spi.LoginModule#commit()
configureCallbacksback to summary
public Callback[] configureCallbacks()
getCallbackHandlerback to summary
public CallbackHandler getCallbackHandler()
getCurrentUserback to summary
public AbstractLoginModule.JAASUserInfo getCurrentUser()
getSubjectback to summary
public Subject getSubject()
getUserInfoback to summary
public abstract UserInfo getUserInfo(String username) throws Exception
initializeback to summary
public void initialize(Subject subject, CallbackHandler callbackHandler, Map<K, V> sharedState, Map<K, V> options)

Implements javax.security.auth.spi.LoginModule.initialize.

Doc from javax.security.auth.spi.LoginModule.initialize.

Initialize this LoginModule.

This method is called by the LoginContext after this LoginModule has been instantiated. The purpose of this method is to initialize this LoginModule with the relevant information. If this LoginModule does not understand any of the data stored in sharedState or options parameters, they can be ignored.

See Also
javax.security.auth.spi.LoginModule#initialize(javax.security.auth.Subject, javax.security.auth.callback.CallbackHandler, java.util.Map, java.util.Map)
isAuthenticatedback to summary
public boolean isAuthenticated()
isCommittedback to summary
public boolean isCommitted()
loginback to summary
public boolean login() throws LoginException

Implements javax.security.auth.spi.LoginModule.login.

Doc from javax.security.auth.spi.LoginModule.login.

Method to authenticate a Subject (phase 1).

The implementation of this method authenticates a Subject. For example, it may prompt for Subject information such as a username and password and then attempt to verify the password. This method saves the result of the authentication attempt as private state within the LoginModule.

Exceptions
LoginException:
if the authentication fails
See Also
javax.security.auth.spi.LoginModule#login()
logoutback to summary
public boolean logout() throws LoginException

Implements javax.security.auth.spi.LoginModule.logout.

Doc from javax.security.auth.spi.LoginModule.logout.

Method which logs out a Subject.

An implementation of this method might remove/destroy a Subject's Principals and Credentials.

Exceptions
LoginException:
if the logout fails
See Also
javax.security.auth.spi.LoginModule#logout()
setAuthenticatedback to summary
public void setAuthenticated(boolean authState)
setCallbackHandlerback to summary
public void setCallbackHandler(CallbackHandler h)
setCommittedback to summary
public void setCommitted(boolean commitState)
setCurrentUserback to summary
public void setCurrentUser(AbstractLoginModule.JAASUserInfo u)
setSubjectback to summary
public void setSubject(Subject s)
org.mortbay.jetty.plus.jaas.spi back to summary

public Class AbstractLoginModule.JAASUserInfo

extends Object
Class Inheritance
  • java.lang.Object
  • org.mortbay.jetty.plus.jaas.spi.AbstractLoginModule.JAASUserInfo

Field Summary

Modifier and TypeField and Description
private Principal
private List<E>
private UserInfo

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public boolean
checkCredential(Object suppliedCredential)

public Principal
public String
public void
public void
public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

principalback to summary
private Principal principal
rolesback to summary
private List<E> roles
userback to summary
private UserInfo user

Constructor Detail

JAASUserInfoback to summary
public JAASUserInfo(UserInfo u)

Method Detail

checkCredentialback to summary
public boolean checkCredential(Object suppliedCredential)
getPrincipalback to summary
public Principal getPrincipal()
getUserNameback to summary
public String getUserName()
setJAASInfoback to summary
public void setJAASInfo(Subject subject)
setUserInfoback to summary
public void setUserInfo(UserInfo u)
unsetJAASInfoback to summary
public void unsetJAASInfo(Subject subject)