Package org.apache.activemq.shiro.authc
Class AuthenticationFilter
- java.lang.Object
-
- org.apache.activemq.broker.BrokerFilter
-
- org.apache.activemq.broker.MutableBrokerFilter
-
- org.apache.activemq.shiro.SecurityFilter
-
- org.apache.activemq.shiro.env.EnvironmentFilter
-
- org.apache.activemq.shiro.authc.AuthenticationFilter
-
public class AuthenticationFilter extends EnvironmentFilter
TheAuthenticationFilter
enforces if authentication is required before allowing the broker filter chain to continue. This implementation performs a connection-level authentication assertion: If theSubject
associated with the connection* is not authenticated, and theAuthenticationPolicy
requires theSubject
to be authenticated, it will attempt tologin
the Subject automatically. TheAuthenticationToken
used to login is created by theauthenticationTokenFactory
, typically by acquiring any credentials associated with the connection. Once the connection'sSubject
is authenticated as necessary, the broker filter chain will continue as expected. *: The upstreamSubjectFilter
is expected to execute before this one, ensuring a Subject instance is already associated with the connection.- Since:
- 5.10.0
-
-
Field Summary
-
Fields inherited from class org.apache.activemq.broker.MutableBrokerFilter
next
-
-
Constructor Summary
Constructors Constructor Description AuthenticationFilter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addConnection(ConnectionContext context, ConnectionInfo info)
A client is establishing a connection with the broker.AuthenticationPolicy
getAuthenticationPolicy()
AuthenticationTokenFactory
getAuthenticationTokenFactory()
protected org.apache.shiro.subject.Subject
getSubject(ConnectionReference conn)
void
removeConnection(ConnectionContext context, ConnectionInfo info, Throwable error)
A client is disconnecting from the broker.void
setAuthenticationPolicy(AuthenticationPolicy authenticationPolicy)
void
setAuthenticationTokenFactory(AuthenticationTokenFactory authenticationTokenFactory)
-
Methods inherited from class org.apache.activemq.shiro.env.EnvironmentFilter
getEnvironment, setEnvironment
-
Methods inherited from class org.apache.activemq.shiro.SecurityFilter
isEnabled, setEnabled
-
Methods inherited from class org.apache.activemq.broker.MutableBrokerFilter
getAdaptor, getNext, setNext
-
Methods inherited from class org.apache.activemq.broker.BrokerFilter
acknowledge, addBroker, addConsumer, addDestination, addDestinationInfo, addProducer, addSession, beginTransaction, brokerServiceStarted, commitTransaction, fastProducer, forgetTransaction, gc, getAdminConnectionContext, getBrokerId, getBrokerName, getBrokerSequenceId, getBrokerService, getClients, getDestinationMap, getDestinationMap, getDestinations, getDestinations, getDurableDestinations, getExecutor, getPeerBrokerInfos, getPreparedTransactions, getRoot, getScheduler, getTempDataStore, getVmConnectorURI, isExpired, isFaultTolerantConfiguration, isFull, isStopped, messageConsumed, messageDelivered, messageDiscarded, messageExpired, messagePull, networkBridgeStarted, networkBridgeStopped, nowMasterBroker, postProcessDispatch, prepareTransaction, preProcessDispatch, processConsumerControl, processDispatchNotification, reapplyInterceptor, removeBroker, removeConsumer, removeDestination, removeDestinationInfo, removeProducer, removeSession, removeSubscription, rollbackTransaction, send, sendToDeadLetterQueue, setAdminConnectionContext, slowConsumer, start, stop, virtualDestinationAdded, virtualDestinationRemoved
-
-
-
-
Method Detail
-
getAuthenticationPolicy
public AuthenticationPolicy getAuthenticationPolicy()
-
setAuthenticationPolicy
public void setAuthenticationPolicy(AuthenticationPolicy authenticationPolicy)
-
getAuthenticationTokenFactory
public AuthenticationTokenFactory getAuthenticationTokenFactory()
-
setAuthenticationTokenFactory
public void setAuthenticationTokenFactory(AuthenticationTokenFactory authenticationTokenFactory)
-
getSubject
protected org.apache.shiro.subject.Subject getSubject(ConnectionReference conn)
-
addConnection
public void addConnection(ConnectionContext context, ConnectionInfo info) throws Exception
Description copied from interface:Broker
A client is establishing a connection with the broker.- Specified by:
addConnection
in interfaceBroker
- Overrides:
addConnection
in classBrokerFilter
- Throws:
Exception
- TODO
-
removeConnection
public void removeConnection(ConnectionContext context, ConnectionInfo info, Throwable error) throws Exception
Description copied from interface:Broker
A client is disconnecting from the broker.- Specified by:
removeConnection
in interfaceBroker
- Overrides:
removeConnection
in classBrokerFilter
- Parameters:
context
- the environment the operation is being executed under.error
- null if the client requested the disconnect or the error that caused the client to disconnect.- Throws:
Exception
- TODO
-
-