public class DbAuthenticator extends AbstractUsernamePasswordAuthenticator
AuthenticatorProfileCreator
.Modifier and Type | Field and Description |
---|---|
protected String |
attributes
This must a list of attribute names separated by commas.
|
protected DataSource |
dataSource |
protected org.skife.jdbi.v2.DBI |
dbi |
protected String |
endQuery |
protected org.slf4j.Logger |
logger |
protected String |
startQuery |
Constructor and Description |
---|
DbAuthenticator() |
DbAuthenticator(DataSource dataSource) |
DbAuthenticator(DataSource dataSource,
String attributes) |
DbAuthenticator(DataSource dataSource,
String attributes,
PasswordEncoder passwordEncoder) |
Modifier and Type | Method and Description |
---|---|
protected DbProfile |
createProfile(String username,
String[] attributes,
Map<String,Object> result) |
String |
getAttributes() |
DataSource |
getDataSource() |
String |
getEndQuery() |
String |
getStartQuery() |
protected void |
internalInit(WebContext context)
Internal initialization of the object.
|
void |
setAttributes(String attributes) |
void |
setDataSource(DataSource dataSource) |
void |
setEndQuery(String endQuery) |
void |
setStartQuery(String startQuery) |
void |
validate(UsernamePasswordCredentials credentials,
WebContext context)
Validate the credentials.
|
getPasswordEncoder, setPasswordEncoder
init, reinit
protected final org.slf4j.Logger logger
protected org.skife.jdbi.v2.DBI dbi
protected DataSource dataSource
protected String attributes
protected String startQuery
protected String endQuery
public DbAuthenticator()
public DbAuthenticator(DataSource dataSource)
public DbAuthenticator(DataSource dataSource, String attributes)
public DbAuthenticator(DataSource dataSource, String attributes, PasswordEncoder passwordEncoder)
protected void internalInit(WebContext context)
InitializableWebObject
internalInit
in class AbstractUsernamePasswordAuthenticator
context
- the web contextpublic void validate(UsernamePasswordCredentials credentials, WebContext context) throws HttpAction
Authenticator
CredentialsException
in case of failure.credentials
- the given credentialscontext
- the web contextHttpAction
- requires a specific HTTP action if necessaryprotected DbProfile createProfile(String username, String[] attributes, Map<String,Object> result)
public DataSource getDataSource()
public void setDataSource(DataSource dataSource)
public String getAttributes()
public void setAttributes(String attributes)
public String getStartQuery()
public void setStartQuery(String startQuery)
public String getEndQuery()
public void setEndQuery(String endQuery)
Copyright © 2016. All rights reserved.