有人使用google或openid登录我的网站时,如何获取用户名和电子邮件? Google返回什么? [英] How do i get the username and email when someone logins to my site using google or openid? What does google return?

查看:120
本文介绍了有人使用google或openid登录我的网站时,如何获取用户名和电子邮件? Google返回什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用pinax,登录我的网站的用户,使用openid,现在是成功的。
i只想在返回时收到用户名和电子邮件。

i used pinax, the user who login my site, use openid, is successful now. i only want to get the username and email when they return .

google openid url是: https://www.google.com/accounts/o8/id

the google openid url is :https://www.google.com/accounts/o8/id

和yahoo openid url是: http://yahoo.com/

and yahoo openid url is :http://yahoo.com/

我如何得到它?

推荐答案

有两种主要的方法来做到这一点。一个是使用OpenID的简单
注册(sreg)扩展。这似乎是最简单的
方式,而当使用myopenid.net作为我的端点时,它的工作,但我
无法让它与谷歌合作。

There are two main methods to do this. One is using the "simple registration" (sreg) extension of OpenID. This seems like the easiest way, and while it worked when using myopenid.net as my endpoint, but I couldn't get it to work with Google.

第二种方法是使用属性交换(ax)扩展名。我能够使用Authkit在Pylons下进行一些调整。我相信你可以对Django做同样的事情。我建议您先从关于AX支持的Google文档开始: http:/ /code.google.com/apis/accounts/docs/OpenID.html

The second method is by using the "attribute exchange" (ax) extension. I was able to get it working using Authkit under Pylons with a bit of tweaking. I'm sure you can do the same with Django. I would recommend that you start with the Google docs regarding their AX support: http://code.google.com/apis/accounts/docs/OpenID.html

这篇关于有人使用google或openid登录我的网站时,如何获取用户名和电子邮件? Google返回什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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