diff --git a/web/src/main/java/org/springframework/security/web/csrf/CsrfAuthenticationStrategy.java b/web/src/main/java/org/springframework/security/web/csrf/CsrfAuthenticationStrategy.java index af6ac23428..a1d0170380 100644 --- a/web/src/main/java/org/springframework/security/web/csrf/CsrfAuthenticationStrategy.java +++ b/web/src/main/java/org/springframework/security/web/csrf/CsrfAuthenticationStrategy.java @@ -56,6 +56,8 @@ public final class CsrfAuthenticationStrategy implements CsrfToken newToken = this.csrfTokenRepository.generateToken(request); this.csrfTokenRepository.saveToken(null, request, response); this.csrfTokenRepository.saveToken(newToken, request, response); + request.setAttribute(CsrfToken.class.getName(), newToken); + request.setAttribute(newToken.getParameterName(), newToken); } } -} \ No newline at end of file +}