SAP Knowledge Base Article - Preview

3670785 - Http request with POST method may end up with "405 Method Not Allowed" error due to in Spring 6 CSRF token handling got slightly changed

Symptom

  • POST mappings fail to work after upgrading to JDK 21 (Spring 6.2)
  • Error message observed: "405 Method Not Allowed".
  • Response headers include "Allow: GET", indicating the backend rejects POST entirely.
  • CSRFToken is missing from the request headers, as well as from request attribute
  • Rule out the issue from the "request path mapping/matching", please see this KBA: 3666354 - Invalid contextPath error after the 2211-jdk21 update


Read more...

Environment

SAP Commerce Cloud -- with JDK 21

Product

SAP Commerce Cloud all versions

Keywords

post mappings, jdk 21 upgrade, 405 method not allowed, csrf token missing, spring security 6, XorCsrfTokenRequestAttributeHandler , KBA , CEC-SCC-PLA-PL , Platform , Problem

About this page

This is a preview of a SAP Knowledge Base Article. Click more to access the full version on SAP for Me (Login required).

Search for additional results

Visit SAP Support Portal's SAP Notes and KBA Search.