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,
ConnectionInfo info) |
AuthenticationPolicy |
getAuthenticationPolicy() |
AuthenticationTokenFactory |
getAuthenticationTokenFactory() |
protected org.apache.shiro.subject.Subject |
getSubject(ConnectionReference conn) |
void |
removeConnection(ConnectionContext context,
ConnectionInfo info,
java.lang.Throwable error) |
void |
setAuthenticationPolicy(AuthenticationPolicy authenticationPolicy) |
void |
setAuthenticationTokenFactory(AuthenticationTokenFactory authenticationTokenFactory) |
getEnvironment, setEnvironmentisEnabled, setEnabledacknowledge, 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, stoppublic 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, ConnectionInfo info) throws java.lang.Exception
addConnection in interface BrokeraddConnection in class MutableBrokerFilterjava.lang.Exceptionpublic void removeConnection(ConnectionContext context, ConnectionInfo info, java.lang.Throwable error) throws java.lang.Exception
removeConnection in interface BrokerremoveConnection in class MutableBrokerFilterjava.lang.ExceptionCopyright © 2005-2016 Red Hat, Inc.. All Rights Reserved.