【发布时间】:2012-10-04 15:01:06
【问题描述】:
我不理解 Microsoft.Web.WebPages.OAuth 命名空间中的一些代码,特别是 OAuthWebSecurity 类。
这里是这个方法:
internal static void RequestAuthenticationCore(HttpContextBase context,
string provider, string returnUrl)
{
IAuthenticationClient client = GetOAuthClient(provider);
var securityManager = new OpenAuthSecurityManager(context,
client, OAuthDataProvider);
securityManager.RequestAuthentication(returnUrl);
}
第一行很好 => 获取提供者数据,用于此身份验证请求。让我们假设这是TwitterClient(..)。
现在,我们需要创建一个 SecurityManager 类 .. 它接受三个参数。第三个参数是什么? OAuthDataProvider?这被定义为静态的,在这里:
internal static IOpenAuthDataProvider OAuthDataProvider =
new WebPagesOAuthDataProvider();
这会创建一个WebPagesOAuthDataProvider。这是我的问题。这是什么?为什么它必须与ExtendedMembershipProvider 紧密耦合?什么是ExtendedMembershipProvider?为什么需要这个?
在我的 Web 应用程序中,我尝试使用 RavenDb 数据库以及我自己的自定义主体和自定义身份。与 ASP.NET 附带的 Membership 或 SimpleMembership 无关。
那个类是什么,为什么要使用它等等?它的目的是什么?这是 DNOA 需要的吗?为什么?
【问题讨论】:
标签: c# asp.net asp.net-mvc dotnetopenauth