Disable 401 redirect - EPI 7.5 MVC



We have a controller, /exampleUrl, that talks to an external API. Our frontend uses AJAX to talk to the controller.

The external API returns an error sometimes and then I want to send a 401 statuscode back to the frontend.

I've noticed that when sending back a 401 to the client, EPI hooks in and redirects me to the loginpage for the CMS...can I somehow turn this off?

I've added this to my web.config but it doesn't work...what am I missing?


Nov 11, 2015 15:49

Heres the correct web.config entry...

  <location path="exampleUrl">
      <authentication mode="None" />
        <allow users="*"/>
      <customErrors mode="Off"></customErrors>

Nov 11, 2015 15:50

Solved it like this.

protected void Application_BeginRequest()
     var startUrl = "/exampleUrl";
         Response.SuppressFormsAuthenticationRedirect = true;
Nov 12, 2015 9:09
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.