public class PasswordAuthenticator extends java.lang.Object implements ISaslAwareAuthenticator
ISaslAwareAuthenticator.SaslAuthenticator
IAuthenticator.Option
PASSWORD_KEY, USERNAME_KEY
Constructor and Description |
---|
PasswordAuthenticator() |
Modifier and Type | Method and Description |
---|---|
void |
alter(java.lang.String username,
java.util.Map<IAuthenticator.Option,java.lang.Object> options)
Called during execution of ALTER USER query.
|
java.util.Set<IAuthenticator.Option> |
alterableOptions()
Subset of supportedOptions that users are allowed to alter when performing ALTER USER [themselves].
|
AuthenticatedUser |
authenticate(java.util.Map<java.lang.String,java.lang.String> credentials)
Authenticates a user given a Map
|
void |
create(java.lang.String username,
java.util.Map<IAuthenticator.Option,java.lang.Object> options)
Called during execution of CREATE USER query (also may be called on startup, see seedSuperuserOptions method).
|
void |
drop(java.lang.String username)
Called during execution of DROP USER query.
|
ISaslAwareAuthenticator.SaslAuthenticator |
newAuthenticator()
Provide a SaslAuthenticator to be used by the CQL binary protocol server.
|
java.util.Set<DataResource> |
protectedResources()
Set of resources that should be made inaccessible to users and only accessible internally.
|
boolean |
requireAuthentication()
Whether or not the authenticator requires explicit login.
|
void |
setup()
Setup is called once upon system startup to initialize the IAuthenticator.
|
java.util.Set<IAuthenticator.Option> |
supportedOptions()
Set of options supported by CREATE USER and ALTER USER queries.
|
void |
validateConfiguration()
Validates configuration of IAuthenticator implementation (if configurable).
|
public boolean requireAuthentication()
IAuthenticator
requireAuthentication
in interface IAuthenticator
public java.util.Set<IAuthenticator.Option> supportedOptions()
IAuthenticator
supportedOptions
in interface IAuthenticator
public java.util.Set<IAuthenticator.Option> alterableOptions()
IAuthenticator
alterableOptions
in interface IAuthenticator
public AuthenticatedUser authenticate(java.util.Map<java.lang.String,java.lang.String> credentials) throws AuthenticationException
IAuthenticator
authenticate
in interface IAuthenticator
AuthenticationException
- if credentials don't match any known user.public void create(java.lang.String username, java.util.Map<IAuthenticator.Option,java.lang.Object> options) throws InvalidRequestException, RequestExecutionException
IAuthenticator
create
in interface IAuthenticator
username
- Username of the user to create.options
- Options the user will be created with.RequestExecutionException
InvalidRequestException
public void alter(java.lang.String username, java.util.Map<IAuthenticator.Option,java.lang.Object> options) throws RequestExecutionException
IAuthenticator
alter
in interface IAuthenticator
username
- Username of the user that will be altered.options
- Options to alter.RequestExecutionException
public void drop(java.lang.String username) throws RequestExecutionException
IAuthenticator
drop
in interface IAuthenticator
username
- Username of the user that will be dropped.RequestExecutionException
public java.util.Set<DataResource> protectedResources()
IAuthenticator
protectedResources
in interface IAuthenticator
public void validateConfiguration() throws ConfigurationException
IAuthenticator
validateConfiguration
in interface IAuthenticator
ConfigurationException
- when there is a configuration error.public void setup()
IAuthenticator
setup
in interface IAuthenticator
public ISaslAwareAuthenticator.SaslAuthenticator newAuthenticator()
ISaslAwareAuthenticator
newAuthenticator
in interface ISaslAwareAuthenticator
PasswordAuthenticator.PlainTextSaslAuthenticator
)Copyright © 2015 The Apache Software Foundation