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

public abstract Class AbstractDatabaseLoginModule

extends AbstractLoginModule
Class Inheritance
Known Direct Subclasses
org.eclipse.jetty.security.jaas.spi.DataSourceLoginModule, org.eclipse.jetty.security.jaas.spi.JDBCLoginModule
Imports
java.sql.Connection, .PreparedStatement, .ResultSet, java.util.ArrayList, .List, .Map, javax.security.auth.Subject, javax.security.auth.callback.CallbackHandler, org.eclipse.jetty.security.UserPrincipal, org.eclipse.jetty.util.security.Credential, org.slf4j.Logger, .LoggerFactory

AbstractDatabaseLoginModule

Abstract base class for LoginModules that interact with a database to retrieve authentication and authorization information. Used by the JDBCLoginModule and DataSourceLoginModule.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public class

Field Summary

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

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public abstract Connection

Returns:

a java.sql.Connection from the database
getConnection
()

public List<String>
getRoles(String userName)

public AbstractLoginModule.JAASUser
getUser(String
user info to load
userName
)

Implements abstract org.eclipse.jetty.security.jaas.spi.AbstractLoginModule.getUser.

Load info from database
public void
initialize(Subject
the subject
subject
,
CallbackHandler
the callback handler
callbackHandler
,
Map<String, ?>
the shared state map
sharedState
,
Map<String, ?>
the option map
options
)

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

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

Initialize this LoginModule.
Inherited from org.eclipse.jetty.security.jaas.spi.AbstractLoginModule:
abortcommitconfigureCallbacksgetCallbackHandlergetCurrentUsergetSubjectisAuthenticatedisCommittedisIgnoredloginlogoutsetAuthenticatedsetCallbackHandlersetCommittedsetCurrentUsersetSubject

Field Detail

dbUserRoleTableback to summary
private String dbUserRoleTable
dbUserRoleTableRoleFieldback to summary
private String dbUserRoleTableRoleField
dbUserRoleTableUserFieldback to summary
private String dbUserRoleTableUserField
dbUserTableback to summary
private String dbUserTable
dbUserTableCredentialFieldback to summary
private String dbUserTableCredentialField
dbUserTableUserFieldback to summary
private String dbUserTableUserField
LOGback to summary
private static final Logger LOG
rolesQueryback to summary
private String rolesQuery
userQueryback to summary
private String userQuery

Constructor Detail

AbstractDatabaseLoginModuleback to summary
public AbstractDatabaseLoginModule()

Method Detail

getConnectionback to summary
public abstract Connection getConnection() throws Exception
Returns:Connection

a java.sql.Connection from the database

Exceptions
Exception:
if unable to get the connection
getRolesback to summary
public List<String> getRoles(String userName) throws Exception
getUserback to summary
public AbstractLoginModule.JAASUser getUser(String userName) throws Exception

Implements abstract org.eclipse.jetty.security.jaas.spi.AbstractLoginModule.getUser.

Load info from database

Parameters
userName:String

user info to load

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

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

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.

Parameters
subject:Subject

Doc from org.eclipse.jetty.security.jaas.spi.AbstractLoginModule.initialize.

the subject

callbackHandler:CallbackHandler

Doc from org.eclipse.jetty.security.jaas.spi.AbstractLoginModule.initialize.

the callback handler

sharedState:Map<String, ?>

Doc from org.eclipse.jetty.security.jaas.spi.AbstractLoginModule.initialize.

the shared state map

options:Map<String, ?>

Doc from org.eclipse.jetty.security.jaas.spi.AbstractLoginModule.initialize.

the option map

Annotations
@Override
org.eclipse.jetty.security.jaas.spi back to summary

public Class AbstractDatabaseLoginModule.JDBCUser

extends JAASUser
Class Inheritance

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public List<String>
Inherited from org.eclipse.jetty.security.jaas.spi.AbstractLoginModule.JAASUser:
checkCredentialfetchRolesgetUserNamesetJAASInfounsetJAASInfo

Constructor Detail

JDBCUserback to summary
public JDBCUser(UserPrincipal user)

Method Detail

doFetchRolesback to summary
public List<String> doFetchRoles() throws Exception

Implements abstract org.eclipse.jetty.security.jaas.spi.AbstractLoginModule.JAASUser.doFetchRoles.

Annotations
@Override