Interface CsrfHmacTokenGenerator<T>

Type Parameters:
T - request
All Superinterfaces:
CsrfTokenGenerator<T>

@Internal public interface CsrfHmacTokenGenerator<T> extends CsrfTokenGenerator<T>
CSRF token Generation with HMAC.
Since:
4.11.0
Author:
Sergio del Amo
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Dot is used as separator between the HMAC and the random value.
  • Method Summary

    Modifier and Type
    Method
    Description
    @NonNull String
    hmac(T request, @NonNull String base64EncodedRandomValue)
    Generates an HMAC.

    Methods inherited from interface io.micronaut.security.csrf.generator.CsrfTokenGenerator

    generateCsrfToken
  • Field Details

    • HMAC_RANDOM_SEPARATOR

      static final String HMAC_RANDOM_SEPARATOR
      Dot is used as separator between the HMAC and the random value. As the random value and hmac are base64 encoded, they will not contain a dot.
      See Also:
  • Method Details

    • hmac

      @NonNull @NonNull String hmac(@NonNull T request, @NonNull @NonNull String base64EncodedRandomValue)
      Generates an HMAC.
      Parameters:
      request - Request
      base64EncodedRandomValue - Cryptographic random value encoded as Base64
      Returns:
      HMAC hash