简体   繁体   English

具有oAuth的自定义成员资格提供程序

[英]Custom Membership provider with oAuth

It's my first contact with MVC so please be understanding for me. 这是我第一次与MVC接触,因此请对我有所了解。 First of all: 首先:

1) If I will implement custom Membership provider with sql database, with my methods to activate user via e-mail, putting user into database etc. (and just one table - tableUsers), this solution about oAuth and Facebook login will works properly? 1)如果我将使用sql数据库实现自定义成员资格提供程序,并通过我的方法通过电子邮件激活用户,将用户放入数据库等(以及仅一个表-tableUsers),那么有关oAuth和Facebook登录的解决方案是否可以正常运行?
Honestly, it's not clear for me at all. 老实说,我一点也不知道。

2) What solution is better. 2)哪种解决方案更好。 My custom membership provider, or using default? 我的自定义成员资格提供程序,还是使用默认值?
I want to sending my custom activation e-mail, then activate account. 我要发送我的自定义激活电子邮件,然后激活帐户。 Later, I want to add new columns into userProfile table - "ID type" and "isActivated". 稍后,我想向userProfile表中添加新列-“ ID类型”和“ isActivated”。
I will storage additional info about user in separate table (telephone, webiste, about me, hobby etc) - I will get this data by IDuser from userProfile. 我将有关用户的其他信息存储在单独的表中(电话,网站,关于我,爱好等)-我将通过IDuser从userProfile中获取此数据。
What is more, I want to use loggin method via Facebook or Twitter. 而且,我想通过Facebook或Twitter使用登录方法。 I found solution on asp.net website, how to do it with Oauth. 我在asp.net网站上找到了解决方案,以及如何使用Oauth进行解决。



What solution I have to choose? 我必须选择什么解决方案?
Regards 问候

What solution is better. 有什么解决方案更好。 My custom membership provider, or using default? 我的自定义成员资格提供程序,还是使用默认值?

As you want to store extra user information in the database, you will need to create your own custom Membership Provider as the default one lacks this flexibility. 当您想在数据库中存储额外的用户信息时,您将需要创建自己的自定义成员资格提供程序,因为默认成员缺乏这种灵活性。 Also with the default membership Provider , you will not be able to verify your user with an activation email. 同样,使用默认的成员资格提供程序,您将无法使用激活电子邮件验证用户。 You will have to customize it. 您将必须对其进行自定义。

How to do it with Oauth.? 如何使用Oauth。

The default Membership Provider provided with MVC4 in VS 2012 has the ability to do login using Facebook and Twitter and you can add even more like LinkedIn. VS 2012中MVC4随附的默认成员资格提供程序可以使用Facebook和Twitter登录,您可以添加更多内容,例如LinkedIn。 But, as you will need to create Custom Membership provider for storing additional information, you can use DotNetOpenAuth library for this. 但是,由于您需要创建用于存储其他信息的自定义成员资格提供程序,因此可以使用DotNetOpenAuth库。 It is the same used by the default Membership Provider. 它与默认成员资格提供程序使用的相同。 You can add it through Nuget . 您可以通过Nuget添加它。

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

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