Problem :
cher.csrf.CsrfTokenGeneratorMatcher sets the CSRF token cookie’s domain using webContext.getServerName(). Behind an API gateway/reverse proxy, the backend server name often differs from the external host (e.g., internal-service vs
app.example.com), so the browser ignores the cookie, breaking CSRF protection.
Expected: CSRF cookie domain should match the external host (e.g., from Host/Forwarded/X-Forwarded-Host) or be configurable. Alternatively, omit domain to use a host-only cookie.
Actual: Domain is derived from backend server name, causing the cookie to be unusable in browsers when proxied.
Affected versions:pac4j-core: 6.2.2
org.pac4j :13.0.0-PLAY3.0