Package com.mdsol.mauth
Class RequestAuthenticator
- java.lang.Object
-
- com.mdsol.mauth.RequestAuthenticator
-
- All Implemented Interfaces:
Authenticator
public class RequestAuthenticator extends java.lang.Object implements Authenticator
-
-
Constructor Summary
Constructors Constructor Description RequestAuthenticator(ClientPublicKeyProvider clientPublicKeyProvider)Uses 10L as default value for request validation timeoutClientPublicKeyProvideras the EpochTimeProviderRequestAuthenticator(ClientPublicKeyProvider clientPublicKeyProvider, boolean v2OnlyAuthenticate)Uses 10L as default value for request validation timeoutClientPublicKeyProvideras the EpochTimeProviderRequestAuthenticator(ClientPublicKeyProvider clientPublicKeyProvider, long requestValidationTimeoutSeconds)UsesClientPublicKeyProvideras the EpochTimeProviderRequestAuthenticator(ClientPublicKeyProvider clientPublicKeyProvider, long requestValidationTimeoutSeconds, boolean v2OnlyAuthenticate)UsesClientPublicKeyProvideras the EpochTimeProviderRequestAuthenticator(ClientPublicKeyProvider clientPublicKeyProvider, long requestValidationTimeoutSeconds, com.mdsol.mauth.util.EpochTimeProvider epochTimeProvider)RequestAuthenticator(ClientPublicKeyProvider clientPublicKeyProvider, long requestValidationTimeoutSeconds, com.mdsol.mauth.util.EpochTimeProvider epochTimeProvider, boolean v2OnlyAuthenticate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanauthenticate(com.mdsol.mauth.MAuthRequest mAuthRequest)Performs the validation of an incoming HTTP request.
-
-
-
Constructor Detail
-
RequestAuthenticator
public RequestAuthenticator(ClientPublicKeyProvider clientPublicKeyProvider)
Uses 10L as default value for request validation timeoutClientPublicKeyProvideras the EpochTimeProvider- Parameters:
clientPublicKeyProvider- PublicKey provider
-
RequestAuthenticator
public RequestAuthenticator(ClientPublicKeyProvider clientPublicKeyProvider, boolean v2OnlyAuthenticate)
Uses 10L as default value for request validation timeoutClientPublicKeyProvideras the EpochTimeProvider- Parameters:
clientPublicKeyProvider- PublicKey providerv2OnlyAuthenticate- the flag to identify authenticate with protocol V2 only or not, if true, clients will authenticate with protocol V2, if false, clients will authenticate with only the highest protocol version (V2 or V1)
-
RequestAuthenticator
public RequestAuthenticator(ClientPublicKeyProvider clientPublicKeyProvider, long requestValidationTimeoutSeconds)
UsesClientPublicKeyProvideras the EpochTimeProvider- Parameters:
clientPublicKeyProvider- PublicKey providerrequestValidationTimeoutSeconds- timeout
-
RequestAuthenticator
public RequestAuthenticator(ClientPublicKeyProvider clientPublicKeyProvider, long requestValidationTimeoutSeconds, boolean v2OnlyAuthenticate)
UsesClientPublicKeyProvideras the EpochTimeProvider- Parameters:
clientPublicKeyProvider- PublicKey providerrequestValidationTimeoutSeconds- timeoutv2OnlyAuthenticate- the flag to identify authenticate with protocol V2 only or not, if true, clients will authenticate with protocol V2, if false, clients will authenticate with only the highest protocol version (V2 or V1)
-
RequestAuthenticator
public RequestAuthenticator(ClientPublicKeyProvider clientPublicKeyProvider, long requestValidationTimeoutSeconds, com.mdsol.mauth.util.EpochTimeProvider epochTimeProvider)
-
RequestAuthenticator
public RequestAuthenticator(ClientPublicKeyProvider clientPublicKeyProvider, long requestValidationTimeoutSeconds, com.mdsol.mauth.util.EpochTimeProvider epochTimeProvider, boolean v2OnlyAuthenticate)
-
-
Method Detail
-
authenticate
public boolean authenticate(com.mdsol.mauth.MAuthRequest mAuthRequest)
Description copied from interface:AuthenticatorPerforms the validation of an incoming HTTP request. The validation process consists of recreating the mAuth hashed signature from the request data and comparing it to the decrypted hash signature from the mAuth header. mauth_client will authenticate with the highest protocol version present and if authentication fails will fallback to lower protocol versions (if provided)- Specified by:
authenticatein interfaceAuthenticator- Parameters:
mAuthRequest- Data from the incoming HTTP request necessary to perform the validation.- Returns:
- True or false indicating if the request is valid or not with respect to mAuth.
-
-