我发现 Asp.Net 中的很多东西都是基于假设的知识。例如,我对互联网身份验证知之甚少,并且很难在初学者级别上找到任何有关它的信息。
令我困惑的一件事是 AuthorizeAttribute。我了解如何使用它以及它应该做什么,但我想知道它是否可以在您拥有自定义登录系统的情况下工作。
在 AuthorizeAttribute 页面上的描述中,它简单地说
When you mark an action method with AuthorizeAttribute, access to that action method is restricted to users who are both authenticated and authorized.
那么什么是经过身份验证的用户,如何设置一个用户进行身份验证。如果我创建自己的登录系统,我该如何设置,以便登录用户的身份验证足以让 AuthorizeAttribute 允许他进入?