Custom Authentication and ASP.NET MVC

前端 未结 5 1390
独厮守ぢ
独厮守ぢ 2020-12-13 00:50

I have an internal web app being built in ASP.NET 4. We are stuck with using an authentication API built by another team. If a user to the site is authenticated

5条回答
  •  忘掉有多难
    2020-12-13 01:36

    Everything you could do in forms you can do in MVC, just set the session variable in the controller login action.

    Or you can do this: In the login action add formsauthentication.setauthcookie("username")

    After this any action with the [Authorize] keyword will allow the current user in.

提交回复
热议问题