Skip to content

docs: use Spring Security's nonce for strict Content Security Policy - #6821

Closed
vaadin-bot wants to merge 1 commit into
mainfrom
doc-bot/vaadin-flow/27471-dc317e2ce8f0d19f
Closed

vaadin-bot wants to merge 1 commit into
mainfrom
doc-bot/vaadin-flow/27471-dc317e2ce8f0d19f

Conversation

@vaadin-bot

Copy link
Copy Markdown
Contributor

Documentation for vaadin/flow#27471 by @heruan.

Note

The source pull request is merged, so this documentation describes the final
shape of the change. Please review it and mark it ready for review.

Change categories: NEW_FEATURE, API_CHANGE, BEHAVIOR_CHANGE

File Change
articles/flow/security/protections/content-security-policy.adoc Rewrote the "Spring Security" subsection: it described the old behavior (Vaadin's strict-mode policy always wins, Spring Security's directives are dropped silently). It now describes the new behavior — when the security filter chain has a Content Security Policy (via HttpSecurity.headers() or the new VaadinSecurityConfigurer.contentSecurityPolicy()), Vaadin uses Spring Security's nonce on its scripts and sends no policy of its own, in every mode and in development mode too. Added the contentSecurityPolicy() usage example, the migration note that a hand-written policy needs the 'nonce-{nonce}' placeholder, and the caveat that a request-matcher-limited or report-only policy silently leaves Vaadin pages unprotected. Also fixed a stale code comment elsewhere on the page that claimed the response's ContentSecurityPolicy is "null unless contentSecurityPolicy is strict" — it can now also be null when Spring Security supplies its own policy.
articles/flow/security/spring/security-configuration.adoc Added a "Content Security Policy Configuration" reference section documenting the three new contentSecurityPolicy() overloads on VaadinSecurityConfigurer, alongside the existing method reference entries for this class, cross-referencing the detailed explanation above.

Auto-generated by the Documentation Bot — review before merging.

Generated by Documentation Bot for #27471 · agent · 98.2 AIC · ⊞ 11.7K · ◷

  • expires on Jan 1, 2027, 9:38 AM UTC

Document that Vaadin now uses the nonce of a Content Security Policy
configured in Spring Security instead of sending its own, and add
VaadinSecurityConfigurer.contentSecurityPolicy() to the Spring Security
configuration reference.

Documents vaadin/flow#27471 (`31cb9fd12b50234e9f34411436079416a375a482`).
@github-actions

github-actions Bot commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

Preview Deployment

This PR has been deployed for preview.

URL: https://docs-preview-pr-6821.fly.dev

Changed pages

Added content is highlighted in green; removed content is marked in red on each page.

Built from 5810340

@heruan

heruan commented Dec 2, 2026

Copy link
Copy Markdown
Member

Closing as a duplicate of #6808, which now has the Security Configuration subsection from this PR.

@heruan heruan closed this Dec 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants