简体   繁体   English

ASP.NET MVC 5自定义实现

[英]ASP.NET MVC 5 Custom Implementation

I was searching for a resource to learn about new ASP.NET MVC 5 Authentication Filters. 我正在寻找一个资源来了解新的ASP.NET MVC 5身份验证过滤器。 Actually what I want is to know how to use Authentication Filters in real world scenarios such as using third party authentication providers (Facebook, Twitter, etc) or custom authentication providers. 实际上我想知道如何在现实世界的场景中使用身份验证过滤器,例如使用第三方身份验证提供程序(Facebook,Twitter等)或自定义身份验证提供程序。 I searched through the internet and was unable to find something in more detail. 我通过互联网搜索,无法更详细地找到一些东西。

Can you suggest me where to find more details on this? 你能建议我在哪里找到更多细节吗? Thanks in advance. 提前致谢。

I've actually implemented a customer authentication in ASP.NET MVC . 我实际上已经在ASP.NET MVC中实现了客户身份验证

The basics are simple: 基础很简单:

  1. For each request coming to the server, you should understand whether the resource is private or public. 对于每个进入服务器的请求,您应该了解资源是私有资源还是公共资源。 This is done with attributes in MVC. 这是通过MVC中的属性完成的。
  2. For each private request, you should see if the HTTP request has an authentication ticket or not. 对于每个私有请求,您应该查看HTTP请求是否具有身份验证票证。 It's usually a cookie. 它通常是一个cookie。
  3. If user does have that ticket, then server the resource. 如果用户确实拥有该票证,则为该资源提供服务。 Otherwise, redirect user to login page. 否则,将用户重定向到登录页面。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM