如何使用 Google 帐户对我们网站中的用户进行身份验证

如何使用 Google 帐户对我们网站中的用户进行身份验证

问题描述:

如何在我们的网站上使用谷歌帐户验证用户.我希望用户被重定向到谷歌登录页面,然后将他重定向到我的网站.我想要这个在 PHP 中的实现.

How to authenticate a user using google account in our website. i want a user to be redirect to google login page and then redirect him to my website. I want this implementation in PHP.

可以使用 OpenID 完成身份验证.Google http://code.google.com/apis/中有详细的文档帐户/文档/OpenID.html

Authentication can be done using OpenID. A detailed document is there in Google http://code.google.com/apis/accounts/docs/OpenID.html

更新:Google 已弃用这些链接.请参阅以下链接以使用 Google 自己的 OAuth2 API 文档,而不是费心阅读库,因为它们非常复杂,最终可能会失去焦点.

Update: The links have been deprecated by Google. Refer to the following links to use Google's own OAuth2 API documentation instead of bothering so much into reading the libraries because they are very complicated and may end up losing focus.