public class AuthenticationFilter extends EnvironmentFilter
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.next
Constructor and Description |
---|
AuthenticationFilter() |
Modifier and Type | Method and Description |
---|---|
void |
addConnection(ConnectionContext context,
org.apache.activemq.command.ConnectionInfo info) |
AuthenticationPolicy |
getAuthenticationPolicy() |
AuthenticationTokenFactory |
getAuthenticationTokenFactory() |
protected org.apache.shiro.subject.Subject |
getSubject(ConnectionReference conn) |
void |
removeConnection(ConnectionContext context,
org.apache.activemq.command.ConnectionInfo info,
Throwable error) |
void |
setAuthenticationPolicy(AuthenticationPolicy authenticationPolicy) |
void |
setAuthenticationTokenFactory(AuthenticationTokenFactory authenticationTokenFactory) |
getEnvironment, setEnvironment
isEnabled, setEnabled
acknowledge, addBroker, addConsumer, addDestination, addDestinationInfo, addProducer, addSession, beginTransaction, brokerServiceStarted, commitTransaction, fastProducer, forgetTransaction, gc, getAdaptor, getAdminConnectionContext, getBrokerId, getBrokerName, getBrokerSequenceId, getBrokerService, getClients, getDestinationMap, getDestinationMap, getDestinations, getDestinations, getDurableDestinations, getExecutor, getNext, 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, setNext, slowConsumer, start, stop
public AuthenticationFilter()
public AuthenticationPolicy getAuthenticationPolicy()
public void setAuthenticationPolicy(AuthenticationPolicy authenticationPolicy)
public AuthenticationTokenFactory getAuthenticationTokenFactory()
public void setAuthenticationTokenFactory(AuthenticationTokenFactory authenticationTokenFactory)
protected org.apache.shiro.subject.Subject getSubject(ConnectionReference conn)
public void addConnection(ConnectionContext context, org.apache.activemq.command.ConnectionInfo info) throws Exception
addConnection
in interface Broker
addConnection
in class MutableBrokerFilter
Exception
public void removeConnection(ConnectionContext context, org.apache.activemq.command.ConnectionInfo info, Throwable error) throws Exception
removeConnection
in interface Broker
removeConnection
in class MutableBrokerFilter
Exception
Copyright © 2005–2016 FuseSource, Corp.. All rights reserved.