2013年5月10日金曜日

Google Apps Migration for Microsoft Exchange 3.xのログにInvalid Consumer Secret specified.と出るけど実際にはConsumer Secretは関係なかった件

Google Apps Migration for Microsoft Exchange – Google Apps ヘルプ



MS Exchange ServerからGoogle Appsへメール、カレンダー、連絡先を移行するツール(以下GAMME)である。このツールを利用するにあたって諸々な準備が必要なんだけど特にOAuthとConsumer Key/Consumer Secretの部分でハマったのでメモである。ツールのログを見ると、


Validating OAuth credentials — destinationaccount@yourdomain.com Invalid Consumer Secret specified. Google Apps server has denied access to these credentials.


とあり一瞬Consumer Secretが間違っているかのようなメッセージである。ちなみにログは以下ディレクトリで参照してください。

XP


C:\Documents and Settings\ユーザー名\Local Settings\Application Data\Google\Google Apps Migration\Tracing\ExchangeMigration


Vista/7


C:\Users\ユーザー名\AppData\Local\Google\Google Apps Sync\Tracing\ExchangeMigration


しかし、実際には違うのだ。GAMMEを利用するにあたって有効化しなければならないAPIのURLは以下の通りであり、恐らく今これを読んでいるあなたはそれくらいご存知だと思う。


https://apps-apis.google.com/a/feeds/emailsettings/2.0/,

https://apps-apis.google.com/a/feeds/user/#readonly,

https://www.google.com/calendar/feeds/,

https://www.google.com/m8/feeds/,

https://www.googleapis.com/auth/apps.groups.migration,

https://apps-apis.google.com/a/feeds/migration/,

https://apps-apis.google.com/a/feeds/group/#readonly


しかしだ、以下URLにアクセスしてOAuthの管理状況を確認してほしい。

https://www.google.com/a/cpanel/[youdomain.com]/SetupOAuth

※ [youdomain.com]は任意のドメインに変更

確かに「すべてのAPIへのアクセスを許可する」にチェックが入っているので当然、前述したAPIも許可されているだろうと決めつけてしまった。しかし、色々と調査してみるとこんなやりとりを発見した。

Invalid Consumer Secret – Googleグループ


Cause: Since the 3.0 update to the GAMME tool, additional APIs are required to perform migrations. The ‘Advanced Tools’->’Manage OAuth Domain Key’ page in the control panel contains a checkbox titled ‘Allow access to all APIs’, which is slightly misleading. This setting doesn’t currently include some newer APIs, so it’s typically more reliable to manually specify scopes in the ‘Advanced Tools’->’Manage third party OAuth client access’ section. The complete list of scopes follows:

(3.0以降のバージョンのGAMMEではOAuthで「すべてのAPIへのアクセスを許可する」にチェックが入っても以下のAPUのURLを追加して許可する必要がある)

https://apps-apis.google.com/a/feeds/emailsettings/2.0/,

https://apps-apis.google.com/a/feeds/user/#readonly,

https://www.google.com/calendar/feeds/,

https://www.google.com/m8/feeds/,

https://www.googleapis.com/auth/apps.groups.migration,

https://apps-apis.google.com/a/feeds/migration/,

https://apps-apis.google.com/a/feeds/group/#readonly

Please ensure that ‘Allow access to all APIs’ is unchecked when manually specifying scopes.

(「すべてのAPIへのアクセスを許可する」にチェックが入っていないか?もし入っていたら外してください。)


実際には「すべてのAPIへのアクセスを許可する」にチェックが入っていても問題は無い。以下のURLからサードパーティの OAuth クライアント アクセスを管理するのだが…

https://www.google.com/a/cpanel/[youdomain.com]/ManageOauthClients

※ [youdomain.com]は任意のドメインに変更

「クライアント名」には既に「すべてのAPIへのアクセスを許可する」しているはずのあのConsumer Keyを入力して、APIをカンマ(,)区切りで貼り付けてやる。そして「承認」でフィニッシュだ。

ということでGAMMEで「Invalid Consumer Secret specified.」というログを見つけたけどConsumer Secret間違ってないのになんでだろう?と思ったらこれを試してみてほしい。

0 件のコメント:

コメントを投稿