Interface CsrfHmacTokenGenerator<T>
- Type Parameters:
T- request
- All Superinterfaces:
CsrfTokenGenerator<T>
CSRF token Generation with HMAC.
- Since:
- 4.11.0
- Author:
- Sergio del Amo
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringDot is used as separator between the HMAC and the random value. -
Method Summary
Methods inherited from interface io.micronaut.security.csrf.generator.CsrfTokenGenerator
generateCsrfToken, generateCsrfToken
-
Field Details
-
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- Requestbase64EncodedRandomValue- Cryptographic random value encoded as Base64- Returns:
- HMAC hash
-
hmac
@NonNull default @NonNull String hmac(@NonNull T request, @Nullable @Nullable Authentication authentication, @NonNull @NonNull String base64EncodedRandomValue) Generates an HMAC bound to the supplied authenticated user. The default implementation ignores the authentication and delegates tohmac(Object, String).- Parameters:
request- Requestauthentication- The authenticated user's representation ornullfor an anonymous requestbase64EncodedRandomValue- Cryptographic random value encoded as Base64- Returns:
- HMAC hash
- Since:
- 4.18.2
-