CSRF
Native Cross Request Site Forgery protection for BoxLang
Built-In Functions
Configuration
"modules": {
"csrf": {
"settings": {
// The cache storage to use for the csrf tokens, by default we use the current session storage cache. You can provide a custom cache to use, as well.
"cacheStorage" : "session",
// The duration in minutes to perform a cache reap of expired tokens
"reapFrequency" : 1,
// By default, all csrf tokens have a life-span of 30 minutes. After 30 minutes, they expire and we auto-generate new ones.
"rotationInterval" : 30,
// The interval in seconds within which, if a token's expiration is impending, we force generate new token for the user.
"timeoutSkew" : 120,
// Whether the the presence of the token should be verified automatically for the verifyMethods
"autoVerify" : false,
// The name of the header to check for automatic token verification, if applicable
"headerName" : "x-csrf-token",
// The methods to verify the token presence, if enabled
"verifyMethods" : [ "POST", "PUT", "PATCH", "DELETE" ]
}
}
}Token Storage
Token Expiration
Auto-Verification
Cache Reaping
GitHub Repository and Reporting Issues
Last updated
Was this helpful?
