这是使用登录/密码和其他社交网络来实现认证的更好的办法? [英] Which is the better way to implement authentication using login/password AND other social networks?

查看:135
本文介绍了这是使用登录/密码和其他社交网络来实现认证的更好的办法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要去尝试解释我的问题:

I'm gonna try to explain my problem :

我想允许用户通过自己的帐户(登录/密码),或者通过社交网络(Facebook的最初)连接到我的API。

I'd like to allow users to connect to my api via their own accounts (login/password) or via a social network (Facebook at first).

然后,我将允许任何应用程序使用我的API,与用户进行身份验证。

Then, I would allow any application to use my api, with the user authenticated.

我首先想到的,当通过他/她的登录/密码要权威性用户并返回作为下一个请求会话令牌。

My first thought when to auth the user via his/her login/password and return a token used as the session for the next requests.

但OAuth的会似乎是更好的实现,但我不知道如何做到这一点:

But OAuth would seems to be the better implementations, except I don't know how to do this :


  • 我的一个应用程序都将通过登录/密码进行连接,如Twitter网站(我有,如果我wan't我的用户登录到某个地方实现一个登录/密码身份验证:P)

  • 我也会有登记我的应用程序的OAuth的系统(没有添加叽叽喳喳的Web应用程序到他们的OAuth?)

  • 如何合并通过其他社交网络的权威性。具体地,用户将必须的OAuth到我的API将权威性的社会网络。

我有点失去了如何做到这一点,如果有人可以帮助我,我真的AP preciate!

I'm a bit lost on how to do this, if someone could help me, I would really appreciate !

感谢

更新1
Flickr和LastFM等似乎不使用OAuth,但另一种身份验证系统,看起来像这样:

Update 1: Flickr and Lastfm seems to not use OAuth but an alternative auth system that looks like this :


  • 将用户重定向到Flickr / LastFM等

  • 的用户验证自己和接受使用的应用程序

  • 的Flickr / LastFM等回到回调URL与临时FROB(对于Flickr的)或令牌(对于LastFM等)

  • 的应用程序必须调用使用临时FROB提供商/令牌(与API_KEY和api_sig中,总是)与得到的回报会话令牌用于下一个电话。

更新2
事实上,StackApps是我的问题的具体案例:您可以通过其登录/密码系统或OpenID登录,并且可以使用他们的API

Update 2: In fact, StackApps is the concrete case of my problem : you can login through their login/password system OR openId, and you can use their API.

推荐答案

的OAuth 时,才需要让别人使用你的API上的其他服务,即授权服务使用您的API没有的中介服务有明确给予用户的登录凭据第三方登录到您的服务用户。

OAuth is only needed to make others use your API on other services, i.e. authorize services to use your API without users of the intermediary service explicitly having to log in into your service by giving user's login credentials to a third party.

我想你需要的是的OpenID ,跨应用程序的验证机制。你只需要实现一个OpenID客户端,接受,当他们使用你的服务的API,第三方的OpenID来验证用户身份,随后识别它们。这将必须补充有一个正常的本地用户认证机制(即,登录/密码输入页)

What I think you need is OpenID, the cross-application authentication mechanism. You just need to implement an OpenID client, accepting third-party OpenIDs to authenticate users, to subsequently identify them, when they use your service's API. This would have to be supplemented with a normal 'local' user authentication mechanism (i.e. login/password entry page)

您需要的OAuth提供使用您的API在其他网站上的能力,虽然。

You will need OAuth to provide an ability to use your API on other sites, though.

这篇关于这是使用登录/密码和其他社交网络来实现认证的更好的办法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆