Package org.apache.activemq.shiro.authc
Interface AuthenticationPolicy
- All Known Implementing Classes:
DefaultAuthenticationPolicy
public interface AuthenticationPolicy
An
AuthenticationPolicy customizes the behavior of the AuthenticationFilter, such as whether or not
authentication is required or how to represent trusted/known Subject identities.
Most will find customizing properties on the DefaultAuthenticationPolicy easier than implementing this
interface directly.- Since:
- 5.10.0
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoidcustomizeSubject(org.apache.shiro.subject.Subject.Builder subjectBuilder, ConnectionReference ref) Allows customization of theSubjectbeing built for the specified client connection.booleanReturnstrueif the connection'sSubjectinstance should be authenticated,falseotherwise.
-
Method Details
-
customizeSubject
void customizeSubject(org.apache.shiro.subject.Subject.Builder subjectBuilder, ConnectionReference ref) Allows customization of theSubjectbeing built for the specified client connection. This allows for any pre-existing connection-specific identity or state to be applied to theSubject.Builderbefore theSubjectinstance is actually created. NOTE: This method is called by theSubjectFilterbefore the filter chain is executed (and before an authentication attempt occurs). Implementations MUST NOT attempt to actuallybuildthe subject or perform an authentication attempt in this method.- Parameters:
subjectBuilder- the builder for the Subject that will be created representing the associated client connectionref- a reference to the client's connection metadata- See Also:
-
isAuthenticationRequired
Returnstrueif the connection'sSubjectinstance should be authenticated,falseotherwise.- Parameters:
ref- the subject's connection- Returns:
trueif the connection'sSubjectinstance should be authenticated,falseotherwise.
-