Class SimpleAuthenticationManager
- java.lang.Object
-
- org.apache.qpid.server.model.AbstractConfiguredObject<T>
-
- org.apache.qpid.server.security.auth.manager.AbstractAuthenticationManager<SimpleAuthenticationManager>
-
- org.apache.qpid.server.security.auth.manager.SimpleAuthenticationManager
-
- All Implemented Interfaces:
EventLoggerProvider
,AuthenticationProvider<SimpleAuthenticationManager>
,ConfiguredObject<SimpleAuthenticationManager>
,ContextProvider
,ManagedInterface
,PasswordCredentialManagingAuthenticationProvider<SimpleAuthenticationManager>
,PermissionedObject
,TaskExecutorProvider
,UsernamePasswordAuthenticationProvider<SimpleAuthenticationManager>
public class SimpleAuthenticationManager extends AbstractAuthenticationManager<SimpleAuthenticationManager> implements PasswordCredentialManagingAuthenticationProvider<SimpleAuthenticationManager>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.qpid.server.model.AbstractConfiguredObject
AbstractConfiguredObject.CallableWithArgument<V,A>, AbstractConfiguredObject.ChainedListenableFuture<V>, AbstractConfiguredObject.ChainedSettableFuture<V>, AbstractConfiguredObject.DuplicateIdException, AbstractConfiguredObject.DuplicateNameException
-
-
Field Summary
-
Fields inherited from class org.apache.qpid.server.model.AbstractConfiguredObject
SECURED_STRING_VALUE
-
Fields inherited from interface org.apache.qpid.server.model.ConfiguredObject
AWAIT_ATTAINMENT_TIMEOUT, CONTEXT, CREATED_BY, CREATED_TIME, DEFAULT_AWAIT_ATTAINMENT_TIMEOUT, DESCRIPTION, DESIRED_STATE, DURABLE, ID, LAST_UPDATED_BY, LAST_UPDATED_TIME, LIFETIME_POLICY, NAME, OVER_SIZED_ATTRIBUTE_ALTERNATIVE_TEXT, STATE, TYPE
-
-
Constructor Summary
Constructors Constructor Description SimpleAuthenticationManager(Map<String,Object> attributes, Container<?> container)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addUser(String username, String password)
AuthenticationResult
authenticate(String username, String password)
Authenticates a user using their username and password.SaslNegotiator
createSaslNegotiator(String mechanism, SaslSettings saslSettings, NamedAddressSpace addressSpace)
boolean
createUser(String username, String password, Map<String,String> attributes)
void
deleteUser(String username)
List<String>
getMechanisms()
Gets the SASL mechanisms known to this manager.Map<String,Map<String,String>>
getUsers()
protected void
postResolveChildren()
void
reload()
Refreshes the cache of user and password data from the underlying storage.void
setPassword(String username, String password)
-
Methods inherited from class org.apache.qpid.server.security.auth.manager.AbstractAuthenticationManager
activate, getAvailableMechanisms, getDisabledMechanisms, getEventLogger, getSecureOnlyMechanisms, logCreated, logDeleted, logOperation, logRecovered, logUpdated, onValidate, startQuiesced
-
Methods inherited from class org.apache.qpid.server.model.AbstractConfiguredObject
addChangeListener, addChildAsync, addFutureCallback, applyToChildren, asObjectRecord, attainState, attributesAsString, attributeSet, authorise, authorise, authorise, authoriseCreateChild, awaitChildClassToAttainState, awaitChildClassToAttainState, beforeClose, beforeDelete, changeAttributes, childAdded, childRemoved, close, closeAsync, closeChildren, create, createAsync, createChild, createChildAsync, decryptSecrets, delete, deleteAsync, deleteChildren, deleteNoChecks, doAfter, doAfter, doAfter, doAfter, doAfter, doAfter, doAfterAlways, doAfterAlways, doCreation, doOnConfigThread, doOpening, doResolution, doSync, doSync, doValidation, findConfiguredObject, forceUpdateAllSecureAttributes, getAccessControl, getActualAttributes, getAncestor, 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, getStatistics, getSubjectWithAddedSystemRights, getSystemPrincipal, getSystemTaskControllerContext, getSystemTaskSubject, getSystemTaskSubject, getTaskExecutor, getType, getTypeClass, getUserPreferences, handleExceptionOnOpen, hasEncrypter, isDurable, isSystemProcess, isSystemSubject, managesChildStorage, newToken, notifyStateChanged, onClose, onCreate, onDelete, onExceptionInOpen, onOpen, onResolve, open, openAsync, postResolve, postSetAttributes, registerWithParents, removeChangeListener, removeContextVariable, rethrowRuntimeExceptionsOnOpen, runTask, setAttributes, setAttributesAsync, setContextVariable, setEncrypter, setState, setUserPreferences, start, startAsync, stop, toString, updateModel, validateChange, validateChildDelete, validateOnCreate
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.qpid.server.model.AuthenticationProvider
getAvailableMechanisms, getDisabledMechanisms, getSecureOnlyMechanisms
-
Methods inherited from interface org.apache.qpid.server.model.ConfiguredObject
addChangeListener, asObjectRecord, authorise, authorise, authorise, close, closeAsync, createChild, createChildAsync, decryptSecrets, delete, deleteAsync, findConfiguredObject, getActualAttributes, getAttainedChildById, getAttainedChildByName, getAttribute, getAttributeNames, getCategoryClass, getChildById, getChildByName, getChildExecutor, getChildren, getContext, getCreatedBy, getCreatedTime, getDescription, getDesiredState, getId, getLastOpenedTime, getLastUpdatedBy, getLastUpdatedTime, getLifetimePolicy, getModel, getName, getObjectFactory, getParent, getState, getStatistics, getStatistics, getType, getTypeClass, getUserPreferences, hasEncrypter, isDurable, managesChildStorage, newToken, open, openAsync, removeChangeListener, removeContextVariable, setAttributes, setAttributesAsync, setContextVariable, setUserPreferences
-
Methods inherited from interface org.apache.qpid.server.model.ContextProvider
getContextKeys, getContextValue, getContextValue
-
Methods inherited from interface org.apache.qpid.server.logging.EventLoggerProvider
getEventLogger
-
Methods inherited from interface org.apache.qpid.server.model.TaskExecutorProvider
getTaskExecutor
-
-
-
-
Method Detail
-
postResolveChildren
protected void postResolveChildren()
- Overrides:
postResolveChildren
in classAbstractConfiguredObject<SimpleAuthenticationManager>
-
getMechanisms
public List<String> getMechanisms()
Description copied from interface:AuthenticationProvider
Gets the SASL mechanisms known to this manager.- Specified by:
getMechanisms
in interfaceAuthenticationProvider<SimpleAuthenticationManager>
- Returns:
- SASL mechanism names, space separated.
-
createSaslNegotiator
public SaslNegotiator createSaslNegotiator(String mechanism, SaslSettings saslSettings, NamedAddressSpace addressSpace)
- Specified by:
createSaslNegotiator
in interfaceAuthenticationProvider<SimpleAuthenticationManager>
-
authenticate
public AuthenticationResult authenticate(String username, String password)
Description copied from interface:UsernamePasswordAuthenticationProvider
Authenticates a user using their username and password.- Specified by:
authenticate
in interfaceUsernamePasswordAuthenticationProvider<SimpleAuthenticationManager>
- Parameters:
username
- usernamepassword
- password- Returns:
- authentication result
-
createUser
public boolean createUser(String username, String password, Map<String,String> attributes)
- Specified by:
createUser
in interfacePasswordCredentialManagingAuthenticationProvider<SimpleAuthenticationManager>
-
deleteUser
public void deleteUser(String username) throws AccountNotFoundException
- Specified by:
deleteUser
in interfacePasswordCredentialManagingAuthenticationProvider<SimpleAuthenticationManager>
- Throws:
AccountNotFoundException
-
setPassword
public void setPassword(String username, String password) throws AccountNotFoundException
- Specified by:
setPassword
in interfacePasswordCredentialManagingAuthenticationProvider<SimpleAuthenticationManager>
- Throws:
AccountNotFoundException
-
getUsers
public Map<String,Map<String,String>> getUsers()
- Specified by:
getUsers
in interfacePasswordCredentialManagingAuthenticationProvider<SimpleAuthenticationManager>
-
reload
public void reload()
Description copied from interface:PasswordCredentialManagingAuthenticationProvider
Refreshes the cache of user and password data from the underlying storage. If there is a failure whilst reloading the data, the implementation must throw anIOException
and revert to using the previous cached username and password data. In this way, the broker will remain usable.- Specified by:
reload
in interfacePasswordCredentialManagingAuthenticationProvider<SimpleAuthenticationManager>
-
-