Package io.aeron.security
Class SimpleAuthenticator
java.lang.Object
io.aeron.security.SimpleAuthenticator
- All Implemented Interfaces:
Authenticator
An authenticator that works off a simple principal/credential pair constructed by a builder. It only supports simple
authentication, not challenge/response.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder to create instances of SimpleAuthenticator. -
Method Summary
Modifier and TypeMethodDescriptionvoidonChallengedSession(SessionProxy sessionProxy, long nowMs) Called when a challenged client should be able to accept a response from the authenticator.voidonChallengeResponse(long sessionId, byte[] encodedCredentials, long nowMs) Called upon reception of a Challenge Response from an unauthenticated client.voidonConnectedSession(SessionProxy sessionProxy, long nowMs) Called when a client's response channel has been connected.voidonConnectRequest(long sessionId, byte[] encodedCredentials, long nowMs) Called upon reception of a Connect Request and will be followed up by multiple calls toAuthenticator.onConnectedSession(SessionProxy, long)once the response channel is connected.
-
Method Details
-
onConnectRequest
public void onConnectRequest(long sessionId, byte[] encodedCredentials, long nowMs) Called upon reception of a Connect Request and will be followed up by multiple calls toAuthenticator.onConnectedSession(SessionProxy, long)once the response channel is connected.- Specified by:
onConnectRequestin interfaceAuthenticator- Parameters:
sessionId- to identify the client session connecting.encodedCredentials- from the Connect Request. Will not be null, but may be 0 length.nowMs- current epoch time in milliseconds.
-
onChallengeResponse
public void onChallengeResponse(long sessionId, byte[] encodedCredentials, long nowMs) Called upon reception of a Challenge Response from an unauthenticated client.- Specified by:
onChallengeResponsein interfaceAuthenticator- Parameters:
sessionId- to identify the client session connecting.encodedCredentials- from the Challenge Response. Will not be null, but may be 0 length.nowMs- current epoch time in milliseconds.
-
onConnectedSession
Called when a client's response channel has been connected. This method may be called multiple times until the session timeouts, is challenged, authenticated, or rejected.- Specified by:
onConnectedSessionin interfaceAuthenticator- Parameters:
sessionProxy- to use to update authentication status. Proxy is only valid for the duration of the call.nowMs- current epoch time in milliseconds.- See Also:
-
onChallengedSession
Called when a challenged client should be able to accept a response from the authenticator.When this is called, there is no assumption that a Challenge Response has been received, plus this method may be called multiple times.
It is up to the concrete class to provide any timeout management.
- Specified by:
onChallengedSessionin interfaceAuthenticator- Parameters:
sessionProxy- to use to update authentication status. Proxy is only valid for the duration of the call.nowMs- current epoch time in milliseconds.- See Also:
-