使用 Janrain 和 OAuth 之间的区别?
我目前使用 Janrain,对 OAuth 不太了解。
有人可以解释一下这两者之间的区别吗?
Im using Janrain at the moment and dont know much about OAuth.
Could someone explain the differences between these two?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
Janrain 使用 OpenID,因此用户必须通过 OpenID 提供商获取身份。您已经知道它是如何工作的:用户与提示输入凭据的提供者进行交互。如果您想要一个接受来自 OpenID 提供商的现有帐户的登录系统,OpenID 是一个很好的解决方案。
就 OAuth 而言,它对最终用户来说是完全透明的。 OAuth 使用令牌,每个令牌授予对特定站点或资源的访问权限,这都是关于“授权”的。您还可以将令牌配置为在定义的持续时间后过期。 OAuth 也可用于登录,这就是 Facebook 的工作原理。
OAuth 示例:
您的网站使用 Janrain 进行身份验证,现在您希望允许用户从 Facebook 导入照片,但用户提供商是 Google(例如)。您将把用户重定向到 Facebook 进行身份验证,并且系统会询问用户是否要授予对您网站的访问权限。如果用户同意,他将被发送回您的网站,并且在后台,您将从 Facebook 获得一个令牌,该令牌必须在未来的通信中用于验证操作。用户绝不会与您的网站共享用户名和密码。
我建议您阅读 OAuth。您可以在此处看到一个非常好的指南,适用于 OAuth 1.0 和 2.0。
Janrain is using OpenID, so the user must get an identity with an OpenID provider. You already know how it work: User interacts with a provider that prompt for credentials. OpenID is a good solution if you want a Sign-In system that accept existing accounts from OpenID providers.
In the case of OAuth, it can be completely transparent to the end-user. OAuth works with Tokens and each token grants access to a specific site or resources, it's all about "authorization". You can also configure a token to expire after a defined duration. OAuth can also be used for Login, that's how Facebook works.
Example with OAuth:
Your website use Janrain for authentication, and now, you want to allow users to import photos from Facebook, but the user provider is Google (for example). You will redirect the user to Facebook for authentication and the user will be asked if he want to grant access to your website. If the user agree, he will be sent back to your website and in background, you'll get a Token from Facebook which must be used in future communication to validate actions. At no point the user shared username and password with your site.
I recommend you to read on OAuth. You can see a really good guide here, for both OAuth 1.0 and 2.0.
Janrain Engage 是一组小部件和后端技术,用于支持可以通过各种 openid 和 oauth 进行身份验证的各种身份提供商。使您无法实施支持 Janrain 支持的 20 多个身份提供商所需的协议。
Janrain Engage is a set of widgets and backend technology to support a variety of identity providers who may be authenticating through various flavors of openid and oauth. Shielding you from implementing the protocols required to support the over 20 identity providers that Janrain supports.
Janrain 和 OAuth 之间没有区别。 Janrain 不是用于社交登录的特定协议。Janrain 创建了一组可与 OpenID 和 OAuth 配合使用的 API - 因此您不必知道其中的区别。
正如 Kevin 所说,Janrain 的社交登录是后端技术,支持各种身份提供商,这些身份提供商可以通过各种风格的 openid 和 oauth 进行身份验证。
因此,Janrain 和 OAuth 之间确实没有区别,只是 Janrain 使用提供商在其社交 API 中使用的技术 - OpenID 和/或 OAuth。
There is no difference between Janrain and OAuth. Janrain is not a particular protocol for social sign in. Janrain creates a set of API's that work with both OpenID and OAuth - so you don't have to know the difference.
like Kevin said, Janrain's Social Login is back-end technology that supports a variety of identity providers who may be authenticating through various flavors of openid and oauth.
So there really is no difference between Janrain and OAuth, it's just that Janrain uses whichever technology the provider is using in their social API - OpenID and/or OAuth.