下面的googlecodesamples链接正在运行。
注意:因为我只能有两个链接,所以我不能指向我的来源
问题堆叠
和开发人员_google_com/accounts/docs/OpenID
https://accounts.google.com/o/openid2/auth?openid.ns=http://specs.openid.net/auth/2.0
&openid.claimed_id=http://specs.openid.net/auth/2.0/identifier_select
&openid.identity=http://specs.openid.net/auth/2.0/identifier_select
&openid.return_to=http://googlecodesamples.com/hybrid/index.php
&openid.realm=http://googlecodesamples.com&openid.mode=checkid_setup
&openid.ns.ui=http://specs.openid.net/extensions/ui/1.0
&openid.ns.ext1=http://openid.net/srv/ax/1.0
&openid.ext1.mode=fetch_request
&openid.ext1.type.email=http://axschema.org/contact/email
&openid.ext1.type.first=http://axschema.org/namePerson/first
&openid.ext1.type.last=http://axschema.org/namePerson/last
&openid.ext1.required=email,first,last
&openid.ns.oauth=http://specs.openid.net/extensions/oauth/1.0
&openid.oauth.consumer=googlecodesamples.com
&openid.oauth.scope=http://www.google.com/m8/feeds/链接以上
它会带您登录/确认并返回一个空白页,但答复url是正确的,如下所示:
http://googlecodesamples.com/hybrid/index.php?
openid.ns=http://specs.openid.net/auth/2.0
openid.mode=id_res
openid.op_endpoint=https://www.google.com/accounts/o8/ud
openid.response_nonce=2012-08-02T22:51:28ZNuhXnuA5P14fcg
openid.return_to=http://googlecodesamples.com/hybrid/index.php
openid.assoc_handle=AMlYA9XA_khrLenZI2mnUwkI1PWV-7ERMRXskVzs_nlFhq87rO0iowVL
openid.signed=op_endpoint,claimed_id,identity,return_to,response_nonce,
assoc_handle,ns.ext1,ns.ext2,ext1.mode,ext1.type.first,ext1.value.first,
ext1.type.email,ext1.value.email,ext1.type.last,ext1.value.last,ext2.scope,
ext2.request_token
openid.sig=JFoYU7PM4GoKBODmLyMtip5q7x4=
openid.identity=https://www.google.com/accounts/o8/id?id=AItOawlvAimmJ5_y6-gMro7Xyl75LXMC7jYCkiA
openid.claimed_id=https://www.google.com/accounts/o8/id?id=AItOawlvAimmJ5_y6-gMro7Xyl75LXMC7jYCkiA
openid.ns.ext1=http://openid.net/srv/ax/1.0
openid.ext1.mode=fetch_response
openid.ext1.type.first=http://axschema.org/namePerson/first
openid.ext1.value.first=nico
openid.ext1.type.email=http://axschema.org/contact/email
openid.ext1.value.email=nico.gtest@gmail.com
openid.ext1.type.last=http://axschema.org/namePerson/last
openid.ext1.value.last=gtest
openid.ns.ext2=http://specs.openid.net/extensions/oauth/1.0
openid.ext2.scope=http://www.google.com/m8/feeds/
openid.ext2.request_token=4/vAQqXlNILhAC0KCIBS2xlhtpo0IT.4lllxzFP7ncSgrKXntQAax2gXBbTcQI其中最重要的部分是openid.ext2.request_token女巫在答复中
但是,如果我更改到我的信息的链接,回复没有任何oauth字段
https://accounts.google.com/o/openid2/auth?openid.ns=http://specs.openid.net/auth/2.0
&openid.claimed_id=http://specs.openid.net/auth/2.0/identifier_select
&openid.identity=http://specs.openid.net/auth/2.0/identifier_select
&openid.return_to=http://dev.oncrm.co.za:9004/gauthapp/myserv?test_v=verify_dbug
&openid.realm=http://dev.oncrm.co.za:9004
&openid.mode=checkid_setup
&openid.ns.ui=http://specs.openid.net/extensions/ui/1.0
&openid.ns.ext1=http://openid.net/srv/ax/1.0
&openid.ext1.mode=fetch_request
&openid.ext1.type.email=http://axschema.org/contact/email
&openid.ext1.type.first=http://axschema.org/namePerson/first
&openid.ext1.type.last=http://axschema.org/namePerson/last
&openid.ext1.required=email,first,last
&openid.ns.oauth=http://specs.openid.net/extensions/oauth/1.0
&openid.oauth.consumer=dev.oncrm.co.za:9004
&openid.oauth.scope=http://www.google.com/m8/feeds/链接以上
我已经在google控制台注册了我的域名
创建了客户端ID和客户端秘密,任何示例的url中都不使用女巫?
打开所有API服务
与示例相同的openid.realm == openid.oauth.consumer
openID部件工作,但无法让google返回openID,所以我可以继续请求access_token
我还使用了openid4java API ( oauth扩展版,第110号),但在oauth上没有成功。
问题
( a)为什么我的链接不起作用,我还必须做什么?
( b)如果不使用客户ID和客户机密,它的概念是什么?
( c)参数: openid.ns.oauth=http://specs.openid.net/extensions/oauth/1.0也困扰着我,openID+OAuth是在oauth1.0还是oauth2.0上工作?
如能提供任何帮助,将不胜感激。
谢谢妮可
发布于 2012-08-05 05:15:31
我在文档中没有见过谷歌声明OpenId + OAuth与OAuth 2.0一起工作的地方。他们所有的文档都指向1.0 OAuth,而我还没有看到谷歌的任何声明说它适用于2.0。
发布于 2012-08-15 08:45:53
正如Mark2.0所指出的,OpenID + OAuth还不能用OAuth 2.0完成,只有1.0。不过,我确实认为1.0适用于您所请求的范围,如果它意味着消除用户的第二个授权步骤,那么在2.0以上使用它可能是值得的。
假设1.0对您有用,我认为链接的问题是您需要使用谷歌的“管理域”工具(https://accounts.google.com/ManageDomains)注册域,而不是使用API控制台。据我所知,API只适用于OAuth 2.0。
假设我的直觉是对的,答案(a)和(c),尽管顺序相反。至于(b),我认为只在OAuth 2.0中使用客户端ID。客户端秘密存在于1.0和2.0中,用于对访问令牌的请求进行签名,在收到请求令牌后进行签名。因此,我们的过程是:(1)获取请求令牌(可以作为OpenID的一部分完成),(2)交换访问令牌的请求令牌,(3)使用访问令牌调用API。
希望这能回答你的问题,但如果没有,请告诉我(或者如果我不在任何地方)。在过去的几天里,我一直在和这些东西搏斗,我很想知道你最近过得怎么样。
发布于 2012-08-27 22:22:54
我设法使它与下面的API和信任
( a)使用(https://accounts.google.com/ManageDomains)设置域,使用(https://developers.google.com/gdata/docs/auth/oauth)创建和上载X.509证书
( b)具有oauth扩展的API openid4java (第110期)
( c)资源和样本
OAuthExample.java from gdata-samples.java-1.47.1
ConsumerServlet.java from openid4java
Sample.java from issue 110( d)使用OAuthRsaSha1Signer进行签名(来自. Upload X.509证书),这样就不需要oauthReqTokenSecret或accessTokenSecret女巫了。
( e)还需要使用ContactsService进行签名
仍然存在对OAuth1的弃用问题,如果等待openid使用OAuth2不是更好的话
,有人知道什么时候会是吗?
https://stackoverflow.com/questions/11788160
复制相似问题