Basic authentication in ASP.NET MVC 5

前端 未结 7 1955
执念已碎
执念已碎 2020-12-07 13:58

What steps must be done to implement basic authentication in ASP.NET MVC 5?

I have read that OWIN does not support cookieless authentication, so is basic authenticat

7条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-07 14:34

    HTTP basic authentication doesn't require a cookie. It's based on a HEADER in the HTTP request. The header is named Authorization and its value should be username and password combined into a string, "username:password" (all base64 encoded).

    Sincerely I never used basic authentication with ASP.NET MVC, but I used Web API to create a custom attribute (you can start from here for WebAPI or here for MVC).

提交回复
热议问题