具有社交登录功能的会员提供商

时间:2021-11-17 19:46:17

I'm using custom nhibernate asp.net membership provider and now I want to allow social login feature (login with fb, twitter, linkedin). I know that already exists in simple membership provider outofbox but I need to support other databases than microsoft sql server, also I'm using code first principle which means that I will generating db tables on the fly.

我正在使用自定义nhibernate asp.net会员提供商,现在我想允许社交登录功能(使用fb,twitter,linkedin登录)。我知道已经存在于简单的成员资格提供者outofbox中,但我需要支持除microsoft sql server之外的其他数据库,我也使用代码优先原则,这意味着我将动态生成数据库表。

I'm looking for solution to extend my current user object (with extend properties to support social net. login).

我正在寻找扩展我当前用户对象的解决方案(使用扩展属性来支持社交网络。登录)。

THanks

谢谢

1 个解决方案

#1


1  

In a common scenario, authentication with social websites has nothing to do with the way you store the data locally. Most providers support the oauth2 protocol which gives you back the username.

在常见情况下,使用社交网站进行身份验证与在本地存储数据的方式无关。大多数提供商都支持oauth2协议,它会返回用户名。

This means that if you store your accounts locally together with non-empty emails (which are somehow authorized), upon authentication the external site returns the information containing an email you can use to find a user in your local store.

这意味着,如果您将本地帐户与非空电子邮件(以某种方式授权)一起存储,则在身份验证时,外部站点将返回包含可用于在本地商店中查找用户的电子邮件的信息。

On the other hand, using a local provider which uses some other database engine is completely unrelated to authentication with external providers. One of reasons people avoid answering your question is probably then that you have mixed two different and unrelated issues in one question.

另一方面,使用使用其他数据库引擎的本地提供程序与使用外部提供程序的身份验证完全无关。人们避免回答你的问题的一个原因可能就是你在一个问题中混合了两个不同且无关的问题。

#1


1  

In a common scenario, authentication with social websites has nothing to do with the way you store the data locally. Most providers support the oauth2 protocol which gives you back the username.

在常见情况下,使用社交网站进行身份验证与在本地存储数据的方式无关。大多数提供商都支持oauth2协议,它会返回用户名。

This means that if you store your accounts locally together with non-empty emails (which are somehow authorized), upon authentication the external site returns the information containing an email you can use to find a user in your local store.

这意味着,如果您将本地帐户与非空电子邮件(以某种方式授权)一起存储,则在身份验证时,外部站点将返回包含可用于在本地商店中查找用户的电子邮件的信息。

On the other hand, using a local provider which uses some other database engine is completely unrelated to authentication with external providers. One of reasons people avoid answering your question is probably then that you have mixed two different and unrelated issues in one question.

另一方面,使用使用其他数据库引擎的本地提供程序与使用外部提供程序的身份验证完全无关。人们避免回答你的问题的一个原因可能就是你在一个问题中混合了两个不同且无关的问题。