Skip to content
Advertisement

Spring Security – 405 Request Method ‘POST’ Not Supported

I have implemented Spring Security to my project, but I am getting status 405 when I try to log in. I have already added csrf token in the form.

This is the error I am getting when I send username and password: HTTP Status 405 - Request method 'POST' not supported

Spring version: 4.0.2.RELEASED

JavaScript

Security Configuration:

JavaScript

Controller:

JavaScript

Almost every topic about this issue says that we need to add csrf token, but I already added. Am I missing something?

Advertisement

Answer

You can set two endpoints for one url. But you cannot set any request parameter as required. As I saw your request map for login, you can set your request method like this:

JavaScript
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement