CsrfDsl

class CsrfDsl

A Kotlin DSL to configure HttpSecurity CSRF protection using idiomatic Kotlin code.

Author

Eleftheria Stein

Since

5.3

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
var csrfTokenRepository: CsrfTokenRepository?

the CsrfTokenRepository to use.

Link copied to clipboard
var csrfTokenRequestHandler: CsrfTokenRequestHandler?

the CsrfTokenRequestHandler to use for making the CSRF token available as a request attribute

Link copied to clipboard
var requireCsrfProtectionMatcher: RequestMatcher?

specify the RequestMatcher to use for determining when CSRF should be applied.

Link copied to clipboard
var sessionAuthenticationStrategy: SessionAuthenticationStrategy?

the SessionAuthenticationStrategy to use.

Functions

Link copied to clipboard
fun disable()

Disable CSRF protection

Link copied to clipboard
fun ignoringRequestMatchers(vararg patterns: String)
fun ignoringRequestMatchers(vararg requestMatchers: RequestMatcher)

Allows specifying HttpServletRequests that should not use CSRF Protection even if they match the requireCsrfProtectionMatcher.