Interface ConnectionSubjectFactory
- All Known Implementing Classes:
DefaultConnectionSubjectFactory
public interface ConnectionSubjectFactory
A
ConnectionSubjectFactory creates a Subject instance that represents the connection client's identity.
Most implementations will simply use the Subject.Builder to create an anonymous
Subject instance and let a downstream AuthenticationFilter authenticate the Subject based on
any credentials associated with the connection. After authentication, the Subject 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 a
Subject instance beyond what the DefaultConnectionSubjectFactory provides, this interface allows that
logic to be plugged in as necessary.- Since:
- 5.10.0
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionorg.apache.shiro.subject.SubjectCreates aSubjectinstance representing the connection client.
-
Method Details
-
createSubject
Creates aSubjectinstance representing the connection client. It is common forSubjectinstances returned from this method to be anonymous until a downstreamAuthenticationFilterauthenticates the subject to associate an identity.- Parameters:
ref- a reference to the client's connection metadata- Returns:
- a
Subjectinstance representing the connection client.
-