如何在我的网站上实施“使用google登录"? [英] How do i implement ‘sign in with google’ on my site?

查看:240
本文介绍了如何在我的网站上实施“使用google登录"?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的网站上,我希望允许用户使用Google帐户登录.我打算使用openid,但我想允许使用google登录,因为它有更多好处.我注意到,过去有一些网站可以使用Google(gmail)帐户和IIRC进行登录,尽管它们不支持openID(但我可能错了).

On my site I would like to allow users to sign in with a google account. I plan to use openid but I would like to allow signing in with google because it has more benefits. I've noticed in the past a few sites that have the ability to sign in with a google (gmail) account and IIRC though they did NOT support openID (but I could be wrong).

如何实现使用Google登录"?

How do I implement 'sign in with google' ?

推荐答案

如果您打算使用OpenID,请使用它. Google已经是OpenID 2.0提供商.

If you plan to use OpenID, use that. Google is already an OpenID 2.0 provider.

Google的OpenID提供程序位于: https://www.google.com/accounts/o8/ud

Google's OpenID provider is located at: https://www.google.com/accounts/o8/ud

(注意:没有必要在浏览器中访问该URI,但它确实适用于OpenID.)

(NOTE: There's no point visiting that URI in your browser, but it does work for OpenID.)

这主要是在帐户API 页上解决的,该页也处理了OAuth以及混合和专有登录系统.根据您的站点,您可能还需要使用 Friend Connect ,它是一个OpenSocial容器,内部使用OpenID进行身份验证.

This is primarily addressed on the Accounts API page, which also addresses OAuth and the hybrid and proprietary login systems. Depending on your site, you may also want to use Friend Connect, which is an OpenSocial container that internally uses OpenID for authentication.

由于我是该项目的DPE,所以我当然偏向于Friend Connect,但是除非您也进行涉及社交图的工作,否则最好直接使用OpenID提供程序来服务您.

I'm of course biased towards Friend Connect, since I'm the DPE for that project, but you're probably better served directly using the OpenID provider unless you're also doing stuff that involves a social graph.

2012年修改:您要使用 OAuth 2.0进行登录. GFC正在关闭

Edit for 2012: You want to use OAuth 2.0 for login. GFC is being shut down.

这篇关于如何在我的网站上实施“使用google登录"?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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