Package org.apache.activemq.shiro.authc
Interface AuthenticationPolicy
-
- All Known Implementing Classes:
DefaultAuthenticationPolicy
public interface AuthenticationPolicy
AnAuthenticationPolicy
customizes the behavior of theAuthenticationFilter
, such as whether or not authentication is required or how to represent trusted/knownSubject
identities. Most will find customizing properties on theDefaultAuthenticationPolicy
easier than implementing this interface directly.- Since:
- 5.10.0
- See Also:
DefaultAuthenticationPolicy
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
customizeSubject(org.apache.shiro.subject.Subject.Builder subjectBuilder, ConnectionReference ref)
Allows customization of theSubject
being built for the specified client connection.boolean
isAuthenticationRequired(SubjectConnectionReference ref)
Returnstrue
if the connection'sSubject
instance should be authenticated,false
otherwise.
-
-
-
Method Detail
-
customizeSubject
void customizeSubject(org.apache.shiro.subject.Subject.Builder subjectBuilder, ConnectionReference ref)
Allows customization of theSubject
being built for the specified client connection. This allows for any pre-existing connection-specific identity or state to be applied to theSubject.Builder
before theSubject
instance is actually created. NOTE: This method is called by theSubjectFilter
before the filter chain is executed (and before an authentication attempt occurs). Implementations MUST NOT attempt to actuallybuild
the 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:
SubjectFilter
-
isAuthenticationRequired
boolean isAuthenticationRequired(SubjectConnectionReference ref)
Returnstrue
if the connection'sSubject
instance should be authenticated,false
otherwise.- Parameters:
ref
- the subject's connection- Returns:
true
if the connection'sSubject
instance should be authenticated,false
otherwise.
-
-