OpenID ファウンデーション・ジャパン

OpenID 2.0 から OpenID Connect への移行のプラクティス @ Google (追記あり)

By tkudo | 2013年12月09日

Google が RP (リライング・パーティ) に返却する「ユーザー識別子」は、同一ユーザーであっても、利用する API によって異なります。たとえば OpenID 2.0 ではユーザー識別子は "https://www.google.com/accounts/o8/id?id=Apt0atlGwa...." のような値ですが、OAuth 2.0 / OpenID Connect では "10016824261..." となります。

このふたつの値には関連性が無く、従来から OpenID 2.0 RP として Google の ID を受け入れていた Web サイト (これまで "OpenID のユーザー識別子" を取得・保持している) においては、OAuth 2.0 / OpenID Connect に移行するにあたっての課題となっていました。

これに対し Google は、OpenID Connect の認証リクエストに OpenID の realm を指定し、ID トークンの値 (クレーム) のひとつとして OpenID のユーザー識別子を返却する、という方法を提供しはじめたようです。

In order to normalize your OpenID2 and OAuth2 (or OpenID Connect) login process you should fully migrate to OAuth2. You can do so (and in the process obtain a map between OpenID2 and OAuth2 identifiers) by updating your OAuth2 requests in the way described below (see "Adjust the OAuth2 request that you send to Google" description below). Once you do this, the OAuth2 response will return both OpenID2 and OAuth2 user identifiers (allowing you to obtain the desired mapping -- see "Response" description below).

how to connect Google openid claimed_id with oauth2 user id - Google Groups

パラメーター名や指定方法などは Google 独自だと思いますが (もしかしたらどこかで議論されてるかも。見逃してたらすみませんがご指摘ください)、基本的な考えかたは以前 ritou さんが話していた案に近いですね。

OID to OIDC idcon mini vol1 from Ryo Ito

※ 2013/12/09 追記: その ritou さんが補足記事を書いてくださいました。そもそもなぜ Google の場合には「認証リクエストに OpenID の realm を指定」が必要なのか? ritou さんが実装するとしたらどうしたいか? など、こちらもぜひあわせてご一読ください。

※ 2013/12/13 追記: US 時間の昨日 (12/12)、公式ドキュメントとして「Migrating off of OpenID 2.0 (OpenID 2.0 からの移行)」が公開されたようです。

If you have an OpenID 2.0-based application, we recommend switching to Google+ Sign-In. If your app is on a platform that Google+ Sign-In does not support, or if you want to work directly with the OAuth 2.0 REST APIs, then we recommend switching to Google's OAuth 2.0 login (OpenID Connect) solution. These two options are described below.

Migrating off of OpenID 2.0 - Federated Login for Google Account Users - Google Accounts Authentication and Authorization -- Google Developers

アーカイブ