Class JWTSecretKeyAuthenticator

All Implemented Interfaces:
RequestAuthenticator

public class JWTSecretKeyAuthenticator extends AbstractJWTAuthenticator
  • Constructor Details

    • JWTSecretKeyAuthenticator

      public JWTSecretKeyAuthenticator(Map<String,String> mapClaimsToCheck, String strJWTHttpHeader, long lValidityPeriod, String strEncryptionAlgorythmName, String strSecretKey)
      Constructor
      Parameters:
      mapClaimsToCheck - The map of claims key/values to check in the JWT
      strJWTHttpHeader - The name of the header which contains the JWT
      lValidityPeriod - The validity period
      strEncryptionAlgorythmName - The name of the algorithm. Values are HS256, HS384, HS512
      strSecretKey - The secret key
  • Method Details

    • isRequestAuthenticated

      public boolean isRequestAuthenticated(jakarta.servlet.http.HttpServletRequest request)
      Check the Authentication of a request
      Specified by:
      isRequestAuthenticated in interface RequestAuthenticator
      Specified by:
      isRequestAuthenticated in class AbstractJWTAuthenticator
      Parameters:
      request - The HTTP request
      Returns:
      true if authenticated, otherwise false
    • getSecurityInformations

      public AuthenticateRequestInformations getSecurityInformations(List<String> elements)
      return Security informations to put in the request headers and request parameters
      Parameters:
      elements - List of elements to include in the signature
      Returns:
      AuthenticateRequestInformations