Interface ConnectionSubjectFactory
-
- All Known Implementing Classes:
DefaultConnectionSubjectFactory
public interface ConnectionSubjectFactory
AConnectionSubjectFactory
creates aSubject
instance that represents the connection client's identity. Most implementations will simply use theSubject.Builder
to create an anonymousSubject
instance and let a downstreamAuthenticationFilter
authenticate theSubject
based on any credentials associated with the connection. After authentication, theSubject
will have an identity, and this is the expected flow for most connection clients. However, if there is some other data associated with the connection that can be inspected to create aSubject
instance beyond what theDefaultConnectionSubjectFactory
provides, this interface allows that logic to be plugged in as necessary.- Since:
- 5.10.0
- See Also:
DefaultConnectionSubjectFactory
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description org.apache.shiro.subject.Subject
createSubject(ConnectionReference ref)
Creates aSubject
instance representing the connection client.
-
-
-
Method Detail
-
createSubject
org.apache.shiro.subject.Subject createSubject(ConnectionReference ref)
Creates aSubject
instance representing the connection client. It is common forSubject
instances returned from this method to be anonymous until a downstreamAuthenticationFilter
authenticates the subject to associate an identity.- Parameters:
ref
- a reference to the client's connection metadata- Returns:
- a
Subject
instance representing the connection client.
-
-