@FunctionalInterface
public interface AuthenticationPlugin
checkOrigin(..),
checkHandshake(..) and onOpen(..) are invoked in
succession.initialAuthentication(..) is
invoked, which evaluates whether the supplied Authorization "Header" value is good, and if so returns a Principal and
a UserId.reevaluateAuthentication(..) and
reevaluateAuthenticationForOutgoingMessage(..) may be invoked several times.authorizeUserForTopic(..) is
invoked to decide whether to allow or deny the subscription.AuthenticationPlugin.SessionAuthenticator: Seen from
the MatsSocketServer, only one thread will ever access any of the methods at any one time, and memory
consistency is handled (i.e. the AuthenticationPlugin.SessionAuthenticator instance is effectively synchronized on): You do
not need to synchronize on anything within an instance of AuthenticationPlugin.SessionAuthenticator, and any fields set on the
instance by some method will be correctly available for subsequent invocations of the same or any other methods.| Modifier and Type | Interface and Description |
|---|---|
static interface |
AuthenticationPlugin.AuthenticationContext |
static interface |
AuthenticationPlugin.AuthenticationResult
You are NOT supposed to implement this interface! Instances of this interface are created by methods on the
AuthenticationPlugin.AuthenticationContext, which you are supposed to return from the AuthenticationPlugin.SessionAuthenticator to inform
the MatsSocketServer about your verdict of the authentication attempt. |
static class |
AuthenticationPlugin.DebugOption
These bit-field enums (bit-field) is used by the Client to request different types of debug/meta information from
Server-side, and used by the
AuthenticationPlugin to tell the MatsSocketServer which types of
information the specific user is allowed to request - the resulting debug/meta information provided is the
intersection of the requested + allowed. |
static interface |
AuthenticationPlugin.SessionAuthenticator
An instance of this interface shall be returned upon invocation of
newSessionAuthenticator(). |
| Modifier and Type | Method and Description |
|---|---|
AuthenticationPlugin.SessionAuthenticator |
newSessionAuthenticator()
Invoked by the
MatsSocketServer upon each WebSocket connection that wants to establish a MatsSocket -
that is, you may provide a connections-specific instance per connection. |
AuthenticationPlugin.SessionAuthenticator newSessionAuthenticator()
MatsSocketServer upon each WebSocket connection that wants to establish a MatsSocket -
that is, you may provide a connections-specific instance per connection. The server will then invoke the
different methods on the returned AuthenticationPlugin.SessionAuthenticator.AuthenticationPlugin.SessionAuthenticator, where the implementation may choose whether it is a
singleton, or if a new instance is returned per invocation (which then means there is a unique instance
per connection, thus you can hold values for the connection there).