Package io.micronaut.security.csrf
Interface CsrfConfiguration
- All Superinterfaces:
io.micronaut.http.cookie.CookieConfiguration
,io.micronaut.core.util.Toggleable
public interface CsrfConfiguration
extends io.micronaut.http.cookie.CookieConfiguration, io.micronaut.core.util.Toggleable
CSRF Configuration.
- Since:
- 4.11.0
- Author:
- Sergio del Amo
-
Field Summary
-
Method Summary
Methods inherited from interface io.micronaut.http.cookie.CookieConfiguration
getCookieDomain, getCookieMaxAge, getCookieName, getCookiePath, getCookieSameSite, isCookieHttpOnly, isCookieSecure
Methods inherited from interface io.micronaut.core.util.Toggleable
isEnabled
-
Field Details
-
PREFIX
- See Also:
-
-
Method Details
-
getRandomValueSize
int getRandomValueSize()- Returns:
- Random value's size in bytes. The random value used is used to build a CSRF Token.
-
getSecretKey
- Returns:
- The Secret Key that is used to calculate an HMAC as part of a CSRF token generation.
-
getHeaderName
HTTP Header name to look for the CSRF token. It is recommended to use a custom request header. By using a custom HTTP Header name, it will not be possible to send them cross-origin without a permissive CORS implementation.- Returns:
- HTTP Header name to look for the CSRF token.
-
getHttpSessionName
- Returns:
- Key to look for the CSRF token in an HTTP Session.
-
getFieldName
- Returns:
- Field name in a form url encoded submission to look for the CSRF token.
-