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
The
AuthenticationFilter enforces if authentication is required before allowing the broker filter chain
to continue.
This implementation performs a connection-level authentication assertion: If the Subject associated with the
connection* is not authenticated, and the
AuthenticationPolicy requires the Subject to be authenticated, it will attempt
to login the Subject automatically. The
AuthenticationToken used to login is created by the
authenticationTokenFactory, typically by acquiring any credentials
associated with the connection.
Once the connection's Subject is authenticated as necessary, the broker filter chain will continue
as expected.
*: The upstream SubjectFilter 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 -
Method Summary
Modifier and TypeMethodDescriptionvoidaddConnection(ConnectionContext context, org.apache.activemq.command.ConnectionInfo info) protected org.apache.shiro.subject.SubjectvoidremoveConnection(ConnectionContext context, org.apache.activemq.command.ConnectionInfo info, Throwable error) voidsetAuthenticationPolicy(AuthenticationPolicy authenticationPolicy) voidsetAuthenticationTokenFactory(AuthenticationTokenFactory authenticationTokenFactory) Methods inherited from class org.apache.activemq.shiro.env.EnvironmentFilter
getEnvironment, setEnvironmentMethods inherited from class org.apache.activemq.shiro.SecurityFilter
isEnabled, setEnabledMethods inherited from class org.apache.activemq.broker.MutableBrokerFilter
getAdaptor, getNext, setNextMethods 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, messageDispatched, 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
-
Constructor Details
-
AuthenticationFilter
public AuthenticationFilter()
-
-
Method Details
-
getAuthenticationPolicy
-
setAuthenticationPolicy
-
getAuthenticationTokenFactory
-
setAuthenticationTokenFactory
-
getSubject
-
addConnection
public void addConnection(ConnectionContext context, org.apache.activemq.command.ConnectionInfo info) throws Exception - Specified by:
addConnectionin interfaceBroker- Overrides:
addConnectionin classBrokerFilter- Throws:
Exception
-
removeConnection
public void removeConnection(ConnectionContext context, org.apache.activemq.command.ConnectionInfo info, Throwable error) throws Exception - Specified by:
removeConnectionin interfaceBroker- Overrides:
removeConnectionin classBrokerFilter- Throws:
Exception
-