0

googlecodesamplesからの次のリンクが機能しています。

注:リンクは2つしかないため、ソースを指定できません

質問stackovergoogle-hybrid-openidoauth-login-not-prompting-for-oauth-access

およびdevelopers_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_tokenwitchが返信に存在することです

しかし、自分の情報へのリンクを変更した場合、返信には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/

上記のリンク

私は自分のドメインをグーグルコンソールに登録しました

クライアントIDとクライアントシークレットを作成しました。どのサンプルのURLでも魔女は使用されていません???

すべてのAPIサービスをオンにします

openid.realm==openid.oauth.consumerサンプルと同じ

openIDの部分は機能しますが、Googleにopenid.ext2.request_tokenを返すよう に取得できないため、引き続き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で動作しています

助けていただければ幸いです

ありがとうニコ

4

3 に答える 3

0

Google が OpenId + OAuth が OAuth 2.0 で動作すると述べているドキュメントのどこにも見たことがありません。すべてのドキュメントは 1.0 OAuth を指しており、2.0 で動作するという Google の声明は見たことがありません。

于 2012-08-05T05:15:31.960 に答える
0

Mark が指摘しているように、OAuth 2.0 で OpenID + OAuth を実行することはまだできず、1.0 のみです。ただし、リクエストしている範囲では 1.0 が機能すると思います。ユーザーの 2 番目の認証手順を排除することを意味する場合は、2.0 よりも使用する価値があるかもしれません。

1.0 が機能すると仮定すると、リンクの問題は、API コンソールではなく、Google の「ドメインの管理」ツール (https://accounts.google.com/ManageDomains) を使用してドメインを登録する必要があることだと思います。API コンソールは、私の知る限り、OAuth 2.0 専用です。

私の勘が正しければ、(a) と (c) の答えは逆順ではありますが。(b) に関しては、私が信じているクライアント ID は OAuth 2.0 でのみ使用されます。1.0 と 2.0 に存在するクライアント シークレットは、アクセストークンのリクエストに署名するために使用されます。これは、リクエスト トークンを受け取った後に行います。したがって、プロセスは次のとおりです。(1) リクエスト トークンを取得する (OpenID 認証の一部として実行できます)、(2) リクエスト トークンをアクセス トークンと交換する、(3) アクセス トークンを使用して API を呼び出す。

これがあなたの質問に答えてくれることを願っていますが、そうでない場合はお知らせください (または、私が基地外にいる場合)。私はここ数日、この問題に取り組んできましたが、あなたがどのように過ごしているかを聞きたいと思っています.

于 2012-08-15T08:45:53.500 に答える
0

次のAPIと構成でなんとかうまくいきました

a) (https://accounts.google.com/ManageDomains) を使用してドメインをセットアップし、(https://developers.google.com/gdata/docs/auth/oauth) を使用して X.509 証明書を作成してアップロードします

b) oauth 拡張機能を持つ API openid4java (issue 110)

c) リソースとサンプル

OAuthExample.java from gdata-samples.java-1.47.1
ConsumerServlet.java from openid4java
Sample.java from issue 110

d)署名にOAuthRsaSha1Signerを使用します (a. X.509 証明書のアップロードから)。OAuthHmacSha1Signer では oauthReqTokenSecret または accessTokenSecret ウィッチが必要です。

e) 署名も ContactsService で行う必要があります

OAuth1 の非推奨についてはまだ懸念があり、openid が OAuth2 で機能するまで待つのが得策ではない場合

それがいつになるか誰にも分かりませんか????

于 2012-08-27T22:22:54.277 に答える