Package org.eclipse.jetty.jaas.spi
Class AbstractLoginModule
- java.lang.Object
-
- org.eclipse.jetty.jaas.spi.AbstractLoginModule
-
- All Implemented Interfaces:
javax.security.auth.spi.LoginModule
- Direct Known Subclasses:
AbstractDatabaseLoginModule
,LdapLoginModule
,PropertyFileLoginModule
public abstract class AbstractLoginModule extends java.lang.Object implements javax.security.auth.spi.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 class
AbstractLoginModule.JAASUserInfo
JAASUserInfo 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 boolean
abort()
boolean
commit()
javax.security.auth.callback.Callback[]
configureCallbacks()
javax.security.auth.callback.CallbackHandler
getCallbackHandler()
AbstractLoginModule.JAASUserInfo
getCurrentUser()
javax.security.auth.Subject
getSubject()
abstract UserInfo
getUserInfo(java.lang.String username)
void
initialize(javax.security.auth.Subject subject, javax.security.auth.callback.CallbackHandler callbackHandler, java.util.Map<java.lang.String,?> sharedState, java.util.Map<java.lang.String,?> options)
boolean
isAuthenticated()
boolean
isCommitted()
boolean
isIgnored()
boolean
login()
boolean
logout()
void
setAuthenticated(boolean authState)
void
setCallbackHandler(javax.security.auth.callback.CallbackHandler h)
void
setCommitted(boolean commitState)
void
setCurrentUser(AbstractLoginModule.JAASUserInfo u)
void
setSubject(javax.security.auth.Subject s)
-
-
-
Method Detail
-
getUserInfo
public abstract UserInfo getUserInfo(java.lang.String username) throws java.lang.Exception
- Throws:
java.lang.Exception
-
getSubject
public javax.security.auth.Subject getSubject()
-
setSubject
public void setSubject(javax.security.auth.Subject s)
-
getCurrentUser
public AbstractLoginModule.JAASUserInfo getCurrentUser()
-
setCurrentUser
public void setCurrentUser(AbstractLoginModule.JAASUserInfo u)
-
getCallbackHandler
public javax.security.auth.callback.CallbackHandler getCallbackHandler()
-
setCallbackHandler
public void setCallbackHandler(javax.security.auth.callback.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 javax.security.auth.login.LoginException
- Specified by:
abort
in interfacejavax.security.auth.spi.LoginModule
- Throws:
javax.security.auth.login.LoginException
- if unable to abort- See Also:
LoginModule.abort()
-
commit
public boolean commit() throws javax.security.auth.login.LoginException
- Specified by:
commit
in interfacejavax.security.auth.spi.LoginModule
- Returns:
- true if committed, false if not (likely not authenticated)
- Throws:
javax.security.auth.login.LoginException
- if unable to commit- See Also:
LoginModule.commit()
-
configureCallbacks
public javax.security.auth.callback.Callback[] configureCallbacks()
-
isIgnored
public boolean isIgnored()
-
login
public boolean login() throws javax.security.auth.login.LoginException
- Specified by:
login
in interfacejavax.security.auth.spi.LoginModule
- Returns:
- true if is authenticated, false otherwise
- Throws:
javax.security.auth.login.LoginException
- if unable to login- See Also:
LoginModule.login()
-
logout
public boolean logout() throws javax.security.auth.login.LoginException
- Specified by:
logout
in interfacejavax.security.auth.spi.LoginModule
- Returns:
- true always
- Throws:
javax.security.auth.login.LoginException
- if unable to logout- See Also:
LoginModule.logout()
-
initialize
public void initialize(javax.security.auth.Subject subject, javax.security.auth.callback.CallbackHandler callbackHandler, java.util.Map<java.lang.String,?> sharedState, java.util.Map<java.lang.String,?> options)
- Specified by:
initialize
in interfacejavax.security.auth.spi.LoginModule
- 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)
-
-