English 中文(简体)
Django & google openid accreditation (openid.ax) with socialauth
原标题:Django & google openid authentication (openid.ax) with socialauth

我正试图利用django-socialauth()认证我的django项目用户。

这是从事开诚布公工作的信托人,我不得不指出这种开诚布公的id。 我对它有越来越多的了解,但现在我看不到什么。

认证程序始于将申请合并到django-socialauth. openid_consumer.views.begin。 我可以看到,即将提出的认证请求正像以下一点:

https://www.google.com/accounts/o8/ud?openid.assoc_handle=AOQobUckRThPUj3K1byG280Aze-dnfc9Iu6AEYaBwvHE11G0zy8kY8GZ&
openid.ax.if_available=fname&
openid.ax.mode=fetch_request&
openid.ax.required=email&
openid.ax.type.email=http://axschema.org/contact/email&
openid.ax.type.fname=http://example.com/schema/fullname&
openid.claimed_id=http://specs.openid.net/auth/2.0/identifier_select&
openid.identity=http://specs.openid.net/auth/2.0/identifier_select&
openid.mode=checkid_setup&openid.ns=http://specs.openid.net/auth/2.0&
openid.ns.ax=http://openid.net/srv/ax/1.0&
openid.ns.sreg=http://openid.net/extensions/sreg/1.1&
openid.realm=http://localhost/&
openid.return_to=http://localhost/social/gmail_login/complete/?janrain_nonce=2010-03-20T11%3A19%3A44ZPZCjNc&openid.sreg.optional=postcode,country,nickname,email

This is lot like 2nd example here: http://code.google.com/apis/accounts/docs/OpenID.html#Samples

问题在于,请求一回头就不像法典中的相应例子。 对应法令一如:

{
 openid.op_endpoint :  https://www.google.com/accounts/o8/ud , 
 openid.sig :  QWMa4x4ruMUvSCfLwKV6CZRuo0E= , 
 openid.ext1.type.email :  http://axschema.org/contact/email , 
 openid.return_to :  http://localhost/social/gmail_login/complete/?janrain_nonce=2010-03-20T17%3A54%3A06ZHV4cqh , 
 janrain_nonce :  2010-03-20T17:54:06ZHV4cqh , 
 openid.response_nonce :  2010-03-20T17:54:06ZdC5mMu9M_6O4pw , 
 openid.claimed_id :  https://www.google.com/accounts/o8/id?id=AItOghawkFz0aNzk91vaQWhD-DxRJo6sS09RwM3SE , 
 openid.mode :  id_res , 
 openid.ns.ext1 :  http://openid.net/srv/ax/1.0 , 
 openid.signed :  op_endpoint,claimed_id,identity,return_to,response_nonce,assoc_handle,ns.ext1,ext1.mode,ext1.type.email,ext1.value.email , 
 openid.ext1.value.email :  my.emailaddress@gmail.com , 
 openid.assoc_handle :  AOQobUfssTJ2IxRlxrIvU4Xg8HHQKKTEuqwGxvwwuPR5rNvag0elGlYL ,
 openid.ns :  http://specs.openid.net/auth/2.0 , 
 openid.identity :  https://www.google.com/accounts/o8/id?id=AItOawkghgfhf1FkvaQWhD-DxRJo6sS09RwMKjASE , 
 openid.ext1.mode :  fetch_response }

社会救助本身是为了接受我的电子邮件地址:

    elif request.openid and request.openid.ax:
        email = request.openid.ax.get( email )

显然,这失败了。

我为什么要问所有这一切,也许我会做一些错误,我即将提出的要求是错误的? 还是正确行事,应当改变社会文化模式,以新的方式接受信息,然后进行变革?

页: 1

最佳回答

Try using the full Depende URI in You ax.get, i.e. ax.get() http://axschema.org/contact/email

问题回答

暂无回答




相关问题
How to get two random records with Django

How do I get two distinct random records using Django? I ve seen questions about how to get one but I need to get two random records and they must differ.

Moving (very old) Zope/Plone Site to Django

I am ask to move data from a (now offline) site driven by Plone to a new Django site. These are the version informations I have: Zope Version (unreleased version, python 2.1.3 ) Python Version 2.1....

Can Django models use MySQL functions?

Is there a way to force Django models to pass a field to a MySQL function every time the model data is read or loaded? To clarify what I mean in SQL, I want the Django model to produce something like ...

Flexible pagination in Django

I d like to implement pagination such that I can allow the user to choose the number of records per page such as 10, 25, 50 etc. How should I go about this? Is there an app I can add onto my project ...

is it convenient to urlencode all next parameters? - django

While writing code, it is pretty common to request a page with an appended "next" query string argument. For instance, in the following template code next points back to the page the user is on: &...

Pragmatically adding give-aways/freebies to an online store

Our business currently has an online store and recently we ve been offering free specials to our customers. Right now, we simply display the special and give the buyer a notice stating we will add the ...

热门标签