Package org.eclipse.jetty.jaas.spi
Class AbstractLoginModule
- java.lang.Object
-
- org.eclipse.jetty.jaas.spi.AbstractLoginModule
-
- All Implemented Interfaces:
LoginModule
- Direct Known Subclasses:
AbstractDatabaseLoginModule,LdapLoginModule,PropertyFileLoginModule
public abstract class AbstractLoginModule extends Object implements LoginModule
AbstractLoginModule Abstract base class for all LoginModules. Subclasses should just need to implement getUserInfo method.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classAbstractLoginModule.JAASUserInfoJAASUserInfo This class unites the UserInfo data with jaas concepts such as Subject and Principals
-
Constructor Summary
Constructors Constructor Description AbstractLoginModule()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description booleanabort()booleancommit()Callback[]configureCallbacks()CallbackHandlergetCallbackHandler()AbstractLoginModule.JAASUserInfogetCurrentUser()SubjectgetSubject()abstract UserInfogetUserInfo(String username)voidinitialize(Subject subject, CallbackHandler callbackHandler, Map<String,?> sharedState, Map<String,?> options)booleanisAuthenticated()booleanisCommitted()booleanisIgnored()booleanlogin()booleanlogout()voidsetAuthenticated(boolean authState)voidsetCallbackHandler(CallbackHandler h)voidsetCommitted(boolean commitState)voidsetCurrentUser(AbstractLoginModule.JAASUserInfo u)voidsetSubject(Subject s)
-
-
-
Method Detail
-
getSubject
public Subject getSubject()
-
setSubject
public void setSubject(Subject s)
-
getCurrentUser
public AbstractLoginModule.JAASUserInfo getCurrentUser()
-
setCurrentUser
public void setCurrentUser(AbstractLoginModule.JAASUserInfo u)
-
getCallbackHandler
public CallbackHandler getCallbackHandler()
-
setCallbackHandler
public void setCallbackHandler(CallbackHandler h)
-
isAuthenticated
public boolean isAuthenticated()
-
isCommitted
public boolean isCommitted()
-
setAuthenticated
public void setAuthenticated(boolean authState)
-
setCommitted
public void setCommitted(boolean commitState)
-
abort
public boolean abort() throws LoginException- Specified by:
abortin interfaceLoginModule- Throws:
LoginException- if unable to abort- See Also:
LoginModule.abort()
-
commit
public boolean commit() throws LoginException- Specified by:
commitin interfaceLoginModule- Returns:
- true if committed, false if not (likely not authenticated)
- Throws:
LoginException- if unable to commit- See Also:
LoginModule.commit()
-
configureCallbacks
public Callback[] configureCallbacks()
-
isIgnored
public boolean isIgnored()
-
getUserInfo
public abstract UserInfo getUserInfo(String username) throws Exception
- Throws:
Exception
-
login
public boolean login() throws LoginException- Specified by:
loginin interfaceLoginModule- Returns:
- true if is authenticated, false otherwise
- Throws:
LoginException- if unable to login- See Also:
LoginModule.login()
-
logout
public boolean logout() throws LoginException- Specified by:
logoutin interfaceLoginModule- Returns:
- true always
- Throws:
LoginException- if unable to logout- See Also:
LoginModule.logout()
-
initialize
public void initialize(Subject subject, CallbackHandler callbackHandler, Map<String,?> sharedState, Map<String,?> options)
- Specified by:
initializein interfaceLoginModule- Parameters:
subject- the subjectcallbackHandler- the callback handlersharedState- the shared state mapoptions- the option map- See Also:
LoginModule.initialize(javax.security.auth.Subject, javax.security.auth.callback.CallbackHandler, java.util.Map, java.util.Map)
-
-