Home > Back-end >  405 Method (POST) not allowed ON IIS
405 Method (POST) not allowed ON IIS

Time:10-07

I have a very simple ASP.NET application that receives a request (POST) from a SSO server (OIDC) with a token in order to autenticate the connection. It has worked in development and preproduction server but in production the (POST) request is returning the following error:

...
Status Code: 405 Method Not Allowed
...
Allow: GET, HEAD, OPTIONS, TRACE
...

We've revised and tried a lot of options in IIS in order to allow the POST HTTP Method ( Authorization Rules, Handler Mappings, ...) but we can't find which is the problem. Another application in the same pool is working (allowing POST verb). I think that the problem is in handler mappings, but I don't know if there's a way to check the handlers really used by the request.


UPDATE

The file web.config is very simple in dev and pre. In pro we've tried some solutions but we've left as it was:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <appSettings>
  ...
  </appSettings>
  <system.web>
    <compilation debug="true" targetFramework="4.6.1" />
    <httpRuntime targetFramework="4.5.2" />
  </system.web>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
    ...
    </assemblyBinding>
  </runtime>
</configuration>

CodePudding user response:

The IT manager of the account has said me that he has removed a folder with the same name of the ASPNET route and it has been worked. I think that IIS was using a handler for folders and not for the aspx. I can't "play" with the server and I can't corroborate the theory but it's logical and the most important, now it's working.

  • Related