Model view controller 如何从ASP.MVC 4中经过身份验证的用户处获取外部登录提供程序的类型?

Model view controller 如何从ASP.MVC 4中经过身份验证的用户处获取外部登录提供程序的类型?,model-view-controller,oauth,asp.net-mvc-4,Model View Controller,Oauth,Asp.net Mvc 4,我将ASP.MVC4与使用表单身份验证的帐户控制器一起使用。我使用OAuthWebSecurity.RegisterFacebookClient等将Facebook和Twitter添加为外部登录提供商。现在我想在控制器和视图中获取用户登录类型(Facebook、Twitter、登录/密码等)。我怎么能得到这个?多谢各位 我在AccountController,action RemoveExternalAllogins中没有自己回答: ICollection<OAuthAccount>

我将ASP.MVC4与使用表单身份验证的帐户控制器一起使用。我使用OAuthWebSecurity.RegisterFacebookClient等将Facebook和Twitter添加为外部登录提供商。现在我想在控制器和视图中获取用户登录类型(Facebook、Twitter、登录/密码等)。我怎么能得到这个?多谢各位

我在AccountController,action RemoveExternalAllogins中没有自己回答:

ICollection<OAuthAccount> accounts = OAuthWebSecurity.GetAccountsFromUserName(User.Identity.Name);
ICollection accounts=OAuthWebSecurity.GetAccountsFromUserName(User.Identity.Name);
和帐户包含提供程序字段-account.provider。对于Facebook,它将是“Facebook”