Package org.eclipse.jetty.jaas.spi
Class JDBCLoginModule
- java.lang.Object
-
- org.eclipse.jetty.jaas.spi.AbstractLoginModule
-
- org.eclipse.jetty.jaas.spi.AbstractDatabaseLoginModule
-
- org.eclipse.jetty.jaas.spi.JDBCLoginModule
-
- All Implemented Interfaces:
javax.security.auth.spi.LoginModule
public class JDBCLoginModule extends AbstractDatabaseLoginModule
JDBCLoginModuleJAAS LoginModule to retrieve user information from a database and authenticate the user.
Notes
This version uses plain old JDBC connections NOT Datasources.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.eclipse.jetty.jaas.spi.AbstractDatabaseLoginModule
AbstractDatabaseLoginModule.JDBCUserInfo
-
Nested classes/interfaces inherited from class org.eclipse.jetty.jaas.spi.AbstractLoginModule
AbstractLoginModule.JAASUserInfo
-
-
Constructor Summary
Constructors Constructor Description JDBCLoginModule()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.sql.Connection
getConnection()
Get a connection from the DriverManagervoid
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)
Init LoginModule.-
Methods inherited from class org.eclipse.jetty.jaas.spi.AbstractDatabaseLoginModule
getRoles, getUserInfo
-
Methods inherited from class org.eclipse.jetty.jaas.spi.AbstractLoginModule
abort, commit, configureCallbacks, getCallbackHandler, getCurrentUser, getSubject, isAuthenticated, isCommitted, isIgnored, login, logout, setAuthenticated, setCallbackHandler, setCommitted, setCurrentUser, setSubject
-
-
-
-
Method Detail
-
getConnection
public java.sql.Connection getConnection() throws java.lang.Exception
Get a connection from the DriverManager- Specified by:
getConnection
in classAbstractDatabaseLoginModule
- Returns:
- the connection for this datasource
- Throws:
java.lang.Exception
- if unable to get the connection- See Also:
AbstractDatabaseLoginModule.getConnection()
-
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)
Init LoginModule.Called once by JAAS after new instance created.
- Specified by:
initialize
in interfacejavax.security.auth.spi.LoginModule
- Overrides:
initialize
in classAbstractDatabaseLoginModule
- Parameters:
subject
- the subjectcallbackHandler
- the callback handlersharedState
- the shared state mapoptions
- the options map- See Also:
LoginModule.initialize(javax.security.auth.Subject, javax.security.auth.callback.CallbackHandler, java.util.Map, java.util.Map)
-
-