Top Description Fields Constructors Methods
org.eclipse.jetty.security.jaas.spi

public Class JDBCLoginModule

extends AbstractDatabaseLoginModule
Class Inheritance
Imports
java.sql.Connection, .DriverManager, java.util.Map, javax.security.auth.Subject, javax.security.auth.callback.CallbackHandler, org.eclipse.jetty.util.Loader, org.slf4j.Logger, .LoggerFactory

JAAS LoginModule to retrieve user information from a database and authenticate the user.

Notes

This version uses plain old JDBC connections NOT DataSources.

Field Summary

Modifier and TypeField and Description
private String
private String
private String
private String
private static final Logger

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Connection

Returns:

the connection for this datasource
getConnection
()

Implements abstract org.eclipse.jetty.security.jaas.spi.AbstractDatabaseLoginModule.getConnection.

Get a connection from the DriverManager
public void
initialize(Subject
the subject
subject
,
CallbackHandler
the callback handler
callbackHandler
,
Map<String, ?>
the shared state map
sharedState
,
Map<String, ?>
the options map
options
)

Overrides org.eclipse.jetty.security.jaas.spi.AbstractDatabaseLoginModule.initialize.

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

Init LoginModule.
Inherited from org.eclipse.jetty.security.jaas.spi.AbstractDatabaseLoginModule:
getRolesgetUser

Field Detail

dbDriverback to summary
private String dbDriver
dbPasswordback to summary
private String dbPassword
dbUrlback to summary
private String dbUrl
dbUserNameback to summary
private String dbUserName
LOGback to summary
private static final Logger LOG

Hides org.eclipse.jetty.security.jaas.spi.AbstractDatabaseLoginModule.LOG.

Constructor Detail

JDBCLoginModuleback to summary
public JDBCLoginModule()

Method Detail

getConnectionback to summary
public Connection getConnection() throws Exception

Implements abstract org.eclipse.jetty.security.jaas.spi.AbstractDatabaseLoginModule.getConnection.

Get a connection from the DriverManager

Returns:Connection

the connection for this datasource

Annotations
@Override
Exceptions
Exception:
if unable to get the connection
initializeback to summary
public void initialize(Subject subject, CallbackHandler callbackHandler, Map<String, ?> sharedState, Map<String, ?> options)

Overrides org.eclipse.jetty.security.jaas.spi.AbstractDatabaseLoginModule.initialize.

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

Init LoginModule.

Called once by JAAS after new instance created.

Parameters
subject:Subject

the subject

callbackHandler:CallbackHandler

the callback handler

sharedState:Map<String, ?>

the shared state map

options:Map<String, ?>

the options map

Annotations
@Override