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

Please note that if CSRFToken is configured correctly, you may review this SAP KBA: 3789344 - Http request with POST method may end up with "405 Method Not Allowed" error due to misconfiguration of "multipart-config" after upgrading to JDK21 and Spring Framework 6.2+, which has a similar symptom (405 error) but due to a different cause.


Read more...

Environment

SAP Commerce Cloud 2211 with JDK 21

Product

SAP Commerce Cloud 2211 for JDK21

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.