Remove authentication in ASP.net MVC single page application

colobusgem picture colobusgem · Jan 29, 2015 · Viewed 16k times · Source

I am trying to play about with the asp.net MVC SPA template in visual studio 2013, I don't need any of the authentication bits, I just need to load directly onto one of the controllers pages.

How do I get rid of all the authentication stuff from the initial template?

Answer

Castro Roy picture Castro Roy · May 15, 2015

Remove the [Authorize] annotation from HomeController and remove this:

@section Scripts{
   @Scripts.Render("~/bundles/knockout")
   @Scripts.Render("~/bundles/app")
}

from Views\Home\Index.cshtml because one of does js is causing the redirect to the login page even after removing the [Authorize] annotation from HomeController and probably you don't need it. If you need these scripts in your page, then you need to edit one of them.