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
TheAuthenticationFilterenforces if authentication is required before allowing the broker filter chain to continue. This implementation performs a connection-level authentication assertion: If theSubjectassociated with the connection* is not authenticated, and theAuthenticationPolicyrequires theSubjectto be authenticated, it will attempt tologinthe Subject automatically. TheAuthenticationTokenused to login is created by theauthenticationTokenFactory, typically by acquiring any credentials associated with the connection. Once the connection'sSubjectis authenticated as necessary, the broker filter chain will continue as expected. *: The upstreamSubjectFilteris 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 voidaddConnection(ConnectionContext context, org.apache.activemq.command.ConnectionInfo info)AuthenticationPolicygetAuthenticationPolicy()AuthenticationTokenFactorygetAuthenticationTokenFactory()protected org.apache.shiro.subject.SubjectgetSubject(ConnectionReference conn)voidremoveConnection(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, 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, 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
-
-
-
-
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, 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
-
-