public abstract class PrincipalDatabaseAuthenticationManager<T extends PrincipalDatabaseAuthenticationManager<T>> extends AbstractAuthenticationManager<T> implements ExternalFileBasedAuthenticationManager<T>, PreferencesSupportingAuthenticationProvider
AbstractConfiguredObject.CallableWithArgument<V,A>, AbstractConfiguredObject.ChainedListenableFuture<V>, AbstractConfiguredObject.ChainedSettableFuture<V>, AbstractConfiguredObject.DuplicateIdException, AbstractConfiguredObject.DuplicateNameException
SECURED_STRING_VALUE
PATH
CONTEXT, CREATED_BY, CREATED_TIME, DESCRIPTION, DESIRED_STATE, DURABLE, ID, LAST_UPDATED_BY, LAST_UPDATED_TIME, LIFETIME_POLICY, NAME, OVER_SIZED_ATTRIBUTE_ALTERNATIVE_TEXT, STATE, TYPE
Modifier | Constructor and Description |
---|---|
protected |
PrincipalDatabaseAuthenticationManager(Map<String,Object> attributes,
Broker broker) |
Modifier and Type | Method and Description |
---|---|
com.google.common.util.concurrent.ListenableFuture<Void> |
activate() |
<C extends ConfiguredObject> |
addChildAsync(Class<C> childClass,
Map<String,Object> attributes,
ConfiguredObject... otherParents) |
AuthenticationResult |
authenticate(SaslServer server,
byte[] response)
Authenticates a user using SASL negotiation.
|
AuthenticationResult |
authenticate(String username,
String password)
Authenticates a user using their username and password.
|
protected void |
changeAttributes(Map<String,Object> attributes) |
protected abstract PrincipalDatabase |
createDatabase() |
SaslServer |
createSaslServer(String mechanism,
String localFQDN,
Principal externalPrincipal)
Creates a SASL server for the specified mechanism name for the given
fully qualified domain name.
|
boolean |
createUser(String username,
String password,
Map<String,String> attributes) |
void |
deleteUser(String username) |
com.google.common.util.concurrent.ListenableFuture<Void> |
doDelete() |
List<String> |
getMechanisms()
Gets the SASL mechanisms known to this manager.
|
String |
getPath() |
PrincipalDatabase |
getPrincipalDatabase() |
protected SecurityManager |
getSecurityManager() |
Map<String,Map<String,String>> |
getUsers() |
void |
initialise() |
protected void |
onCreate() |
protected void |
onOpen() |
protected void |
postResolve() |
void |
reload()
Refreshes the cache of user and password data from the underlying storage.
|
void |
setPassword(String username,
String password) |
protected void |
validateChange(ConfiguredObject<?> updatedObject,
Set<String> changedAttributes) |
protected void |
validateOnCreate() |
getBroker, getDisabledMechanisms, getPreferencesProvider, getSecureOnlyMechanisms, getSubjectCreator, getVirtualHostPortBindings, onValidate, recoverUser, setPreferencesProvider, startQuiesced
addChangeListener, applyToChildren, asObjectRecord, attainState, attributeSet, authoriseCreate, authoriseCreateChild, authoriseDelete, authoriseSetAttributes, beforeClose, changeAttribute, childAdded, childRemoved, close, closeAsync, closeChildren, create, createAsync, createChild, createChildAsync, decryptSecrets, delete, deleteAsync, deleted, doAfter, doAfter, doAfter, doAfter, doAfter, doAfter, doAfterAlways, doAfterAlways, doCreation, doOnConfigThread, doOpening, doResolution, doSync, doSync, doValidation, findConfiguredObject, forceUpdateAllSecureAttributes, getActualAttributes, getAttainedChildById, getAttainedChildByName, getAttribute, getAttributeNames, getCategoryClass, getChildById, getChildByName, getChildExecutor, getChildren, getContext, getContextKeys, getContextValue, getContextValue, getCreatedBy, getCreatedTime, getDescription, getDesiredState, getId, getLastOpenedTime, getLastUpdatedBy, getLastUpdatedTime, getLifetimePolicy, getModel, getName, getObjectFactory, getParent, getState, getStatistics, getTaskExecutor, getType, getTypeClass, handleExceptionOnOpen, isDurable, managesChildStorage, notifyStateChanged, onClose, onExceptionInOpen, onResolve, open, openAsync, parentsMap, postResolveChildren, registerWithParents, removeChangeListener, rethrowRuntimeExceptionsOnOpen, runTask, setAttribute, setAttributes, setAttributesAsync, setEncrypter, setState, start, startAsync, stop, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getDisabledMechanisms, getPreferencesProvider, getSecureOnlyMechanisms, getSubjectCreator, getVirtualHostPortBindings, recoverUser, setPreferencesProvider
addChangeListener, asObjectRecord, close, closeAsync, createChild, createChildAsync, decryptSecrets, delete, deleteAsync, findConfiguredObject, getActualAttributes, getAttainedChildById, getAttainedChildByName, getAttribute, getAttributeNames, getCategoryClass, getChildById, getChildByName, getChildExecutor, getChildren, getContext, getContextKeys, getContextValue, getContextValue, getCreatedBy, getCreatedTime, getDescription, getDesiredState, getId, getLastOpenedTime, getLastUpdatedBy, getLastUpdatedTime, getLifetimePolicy, getModel, getName, getObjectFactory, getParent, getState, getStatistics, getTaskExecutor, getType, getTypeClass, isDurable, managesChildStorage, open, openAsync, removeChangeListener, setAttribute, setAttributes, setAttributesAsync
getPreferencesProvider, setPreferencesProvider
protected void validateOnCreate()
validateOnCreate
in class AbstractConfiguredObject<T extends PrincipalDatabaseAuthenticationManager<T>>
protected void onCreate()
onCreate
in class AbstractConfiguredObject<T extends PrincipalDatabaseAuthenticationManager<T>>
protected void onOpen()
onOpen
in class AbstractAuthenticationManager<T extends PrincipalDatabaseAuthenticationManager<T>>
protected void postResolve()
postResolve
in class AbstractConfiguredObject<T extends PrincipalDatabaseAuthenticationManager<T>>
protected abstract PrincipalDatabase createDatabase()
public String getPath()
getPath
in interface ExternalFileBasedAuthenticationManager<T extends PrincipalDatabaseAuthenticationManager<T>>
public void initialise()
public List<String> getMechanisms()
AuthenticationProvider
getMechanisms
in interface AuthenticationProvider<T extends PrincipalDatabaseAuthenticationManager<T>>
public SaslServer createSaslServer(String mechanism, String localFQDN, Principal externalPrincipal) throws SaslException
AuthenticationProvider
createSaslServer
in interface AuthenticationProvider<T extends PrincipalDatabaseAuthenticationManager<T>>
mechanism
- mechanism namelocalFQDN
- domain nameexternalPrincipal
- externally authenticated PrincipalSaslException
public AuthenticationResult authenticate(SaslServer server, byte[] response)
AuthenticationProvider
authenticate
in interface AuthenticationProvider<T extends PrincipalDatabaseAuthenticationManager<T>>
server
- SASL serverresponse
- SASL response to processAuthenticationProvider.authenticate(SaslServer, byte[])
public AuthenticationResult authenticate(String username, String password)
UsernamePasswordAuthenticationProvider
authenticate
in interface UsernamePasswordAuthenticationProvider<T extends PrincipalDatabaseAuthenticationManager<T>>
username
- usernamepassword
- passwordUsernamePasswordAuthenticationProvider.authenticate(String, String)
public PrincipalDatabase getPrincipalDatabase()
public com.google.common.util.concurrent.ListenableFuture<Void> activate()
activate
in class AbstractAuthenticationManager<T extends PrincipalDatabaseAuthenticationManager<T>>
public com.google.common.util.concurrent.ListenableFuture<Void> doDelete()
doDelete
in class AbstractAuthenticationManager<T extends PrincipalDatabaseAuthenticationManager<T>>
public boolean createUser(String username, String password, Map<String,String> attributes)
createUser
in interface PasswordCredentialManagingAuthenticationProvider<T extends PrincipalDatabaseAuthenticationManager<T>>
public void deleteUser(String username) throws AccountNotFoundException
deleteUser
in interface PasswordCredentialManagingAuthenticationProvider<T extends PrincipalDatabaseAuthenticationManager<T>>
AccountNotFoundException
protected SecurityManager getSecurityManager()
getSecurityManager
in class AbstractConfiguredObject<T extends PrincipalDatabaseAuthenticationManager<T>>
public void setPassword(String username, String password) throws AccountNotFoundException
setPassword
in interface PasswordCredentialManagingAuthenticationProvider<T extends PrincipalDatabaseAuthenticationManager<T>>
AccountNotFoundException
public Map<String,Map<String,String>> getUsers()
getUsers
in interface PasswordCredentialManagingAuthenticationProvider<T extends PrincipalDatabaseAuthenticationManager<T>>
public void reload() throws IOException
PasswordCredentialManagingAuthenticationProvider
IOException
and revert to using the previous cached username
and password data. In this way, the broker will remain usable.reload
in interface PasswordCredentialManagingAuthenticationProvider<T extends PrincipalDatabaseAuthenticationManager<T>>
IOException
public <C extends ConfiguredObject> com.google.common.util.concurrent.ListenableFuture<C> addChildAsync(Class<C> childClass, Map<String,Object> attributes, ConfiguredObject... otherParents)
addChildAsync
in class AbstractAuthenticationManager<T extends PrincipalDatabaseAuthenticationManager<T>>
protected void validateChange(ConfiguredObject<?> updatedObject, Set<String> changedAttributes)
validateChange
in class AbstractConfiguredObject<T extends PrincipalDatabaseAuthenticationManager<T>>
protected void changeAttributes(Map<String,Object> attributes)
changeAttributes
in class AbstractConfiguredObject<T extends PrincipalDatabaseAuthenticationManager<T>>
Copyright © 2006–2016 The Apache Software Foundation. All rights reserved.