このアプリでは「Googleでログイン」機能が一時的に無効が表示された時の対応


ことの発端とエラー内容

2018/7某日、これまでは問題なく動いていたGoogleのOAuthを利用するアプリケーションにおいて、Googleログイン時に下記のエラーが発生するようになった。

  • 利用しているユーザーのアカウントでのみ発生
  • 運営側のアカウントでは発生しない

というケースだったため確認が遅れたが、なんらかの事情でGoogleログインがGoogle側から拒否されたものと思われる。

過去にOAuth Developer Verification Formの申請は行なっていたため、なんらかのタイミング・基準によってGoogleからの許可が外されたものと思われるが、その原因は不明なうえ、事前の通知等も一切なかった。ひとまずどうしようもないので、再申請を行なった。

この再申請に非常に手間と時間がかかったため、何かの一助となればと思い再申請のプロセスを適宜記載しておく。

前提

Googleログイン(OAuth)を利用するアプリケーション(例えば利用者のGoogleカレンダー情報を取得するケースなど)を公開する場合、OAuth Developer Verification Formからの申請およびGoogleからの承認が必要となる。

こちらは数年前は必要なかったが、2017年頃から申請が必須になり、Googleからの承認が降りない場合はGoogleログイン機能を利用することができない。(参考)

なお、Google APIコンソールにそのプロジェクトのオーナー/編集者として登録されたアカウントの場合、テスト目的でGoogleログインを利用できる。そのため、前述のような運営側のGoogleアカウントでは発生しないが、ユーザーのGoogleアカウントではエラーが発生するという事象が発生した。

OAuth Developer Verification Formの申請

OAuth Developer Verification Formの申請内容は大きく下記の通り。

申請の前提

申請のFAQ

事前にこちらを確認しておくとベター。
https://support.google.com/googleapi/answer/7394288

サーチコンソールでのドメインの確認

当該アプリケーションが自身の保持するドメインで運営されていることをGoogle側に示すために、サーチコンソールでドメインの所有権の確認を行う必要がある。詳細は下記のヘルプ参照。
https://www.google.com/webmasters/tools/home
https://support.google.com/webmasters/answer/35179?hl=ja

プライバシーポリシーの作成

プライバシーポリシーがない場合、そもそも申請ができない。事前に作成が必要。

申請項目

Contact Info

申請者の情報。難しい話はないので割愛。

Product Details

申請するサービスの情報。迷いそうな項目のみ詳細を記す。

Project ID

OAuthの設定時に作成した、GoogleCloudPlatformのProjectID。
こちらに表示される「プロジェクトID」を記載。

OAuth Client ID

OAuthの設定時に作成したOAuth 2.0 クライアント IDを記載。
こちらに表示される、当該申請を行いたいアプリケーションに紐づく認証情報の「クライアント ID」を記載。

Link to your privacy policy

申請を行うアプリケーションのプライバシーポリシーのURLを記載。
プライバシーポリシーがない場合、そもそも申請ができない。

Which scopes does your app need access to?

OAuthを利用してどのスコープにアクセスする必要があるかを記載する。
スコープの一覧はこちらを参照。
複数ある場合はカンマ区切りで記載する。

(例)
https://www.googleapis.com/auth/calendar.readonly,https://www.googleapis.com/auth/hogehoge

List the specific ways your app will use each of the scopes you're requesting and explain the features in your app that require these scopes.

上述したスコープを、どのような用途で利用するかを英語で記載する。
スコープ名:スコープを利用する理由、の形で記載する。

my app will use 
https://www.googleapis.com/auth/calendar.readonly
to show a user's calendar data on the scheduling screen of my app to help users manage their schedule directly through my app.

申請後のやりとり

ここからは申請後のGoogleとのやりとりを記す。他にもGoogleから指摘が入るケースがあると思われるが、今回発生したやりとりをすべて記載する。

なお、Googleからの返答はだいたい1営業日後くらいに来た。返答の送信時間的に、日本ではなく海外からの返答と思われる。

また、返答はすべて英語でくるうえ、英語で回答する必要がある。

返答1: 社外利用の確認

申請を見てみたが、社内で使うものに見えた。社外の人も使うならば返信が欲しいという旨。
社内の人だけが使うなら、そのまま使えるし返信不要。
社外の人も使うから承認プロセスを勧めてくれと返信。


Dear Developer,
Thank you for submitting the developer verification form.

Based on your inputs, your project is used by the people in your company. If this is the case, please associate your project with your organization by following the steps below.

Create an Organization if you do not have one as instructed in Quickstart Using Organizations.

Migrate the project into the organization you created as shown on the Migrating Existing Projects into the Organization page.

Once you have associated your project with your organization, you and the project users in your organization can use the app directly to access OAuth scopes and no verification will be required.

However, if your app is used by the people outside of your company, or if you wish to continue with the verification process, please reply back to us to move forward with the review process.

返答2: スコープの確認

申請内容によると、もっと制限されたスコープで十分なんじゃないかという指摘。
Google側の指摘がおかしい場合はその旨を返答、そうじゃない場合はスコープを変更する旨を返答。
この場合はreadonlyでも良かったため、その旨を返答。

Dear Developer,
Thank you for submitting the developer verification form. As a general rule, choose the most restrictive scope possible, as users more readily grant access to limited, clearly described scopes. Thus we recommend you to consider using the following scopes that are necessary to implement your app's feature.

https://www.googleapis.com/auth/admin.directory.resource.calendar.readonly
Instead of following scopes that you have requested

https://www.googleapis.com/auth/admin.directory.resource.calendar
For reference, a full list of OAuth scopes can be found on the OAuth 2.0 Scopes page.

Please reply to this email with confirmation regarding above scopes, or provide a justification if the recommended scopes do not work for your app.  

Please refer this FAQ to ensure your verification request is complete.

Thank you for patience.

返答3: ブランドガイドライン違反

ログインボタンがGoogleのブランドガイドラインに違反しているとのお達し。
基本的にはGoogleが提供する素材を使ってくれといった形だったので、ガイドラインにある画像をボタンで利用する形に修正し、修正版のリリースを行なった上でGoogleにその旨返答。

デザインはかなり細かく規定されているため、ガイドラインに違反しているサービスは多い印象です。申請時には要注意と思われます。

Dear Developer,
The Google sign-in button on your app’s homepage URL https://hogehoge.com/ is not compliant with the Google sign-in branding guidelines. Please update the Google sign-in button on your website according to the Google sign-in branding guidelines and then reply back to this email. 

We’ll review the Google sign-in button on your website again. If it meets the requirements listed in the branding guidelines, we will move forward with the review process for your client id hogehoge.apps.googleusercontent.com.

Thank you for patience. Please feel free to reach out to us with any questions.

返答4: HTTPはNG

リダイレクト先はすべてHTTPSにしろとのお達し。
過去に設定したHTTPのものが残っていたため指摘が入った形。
これを機にサービスをすべてHTTPSに変更し、認証情報もそれに合わせる形で修正し、その旨を返信した。

このあたりは、サービスによってはかなり対応が厳しいかもしれませんが、HTTPS化は世の中って機に必須の流れなので頑張りましょう。

Dear Developer,
Please ensure your redirect URIs and post message origin URLs are encrypted and secure to ensure data theft does not take place. It can be done by using an HTTPS protocol (a secure, encrypted connection). Please reply back once you have updated following redirect URIs or postmessage origin URLs for us to proceed with the verification process.

http://hogehoge/auth/google_oauth2/callback
Note: There are many free services like this which can be used to encrypt URLs.

返答5: テストアカウントの共有

Google側でテストしたいので、テストアカウントを共有してくれとのお達し。
テストアカウントのメールアドレスとパスワードを返答。
そこはメールで共有させるんだ、、、という微妙な違和感があるがしょうがないので従う。


Dear Developer,
Thank you for your patience. Please reply back with a test account email and password, so we can experience the user sign-up flow, validate the app services and then proceed with OAuth Verification process.
Please do not hesitate to reach out to us if you have questions or concerns.

返答6: 認証フローの動画が必要

どのようにしてユーザがアプリをインストールするか、権限を許可するか、申請したスコープをアプリ内でどのように使うか、、などを動画に撮って送れとのこと。
テストアカウントを共有したので見てくれれば良いと思いつつ、しょうがないので動画を撮って送った。

これ以上やり取りを増やしたくなかったため、ログインフローだけでなく、申請したスコープを使う部分の挙動を動画に撮り、簡単な説明とともに返答した。

Macの場合、QuickTime Playerで簡単に動画が撮れるので便利。
QuickTime Player ヘルプ

Dear Developer,
Thank you for your patience. 

Please reply back with a YouTube video link or video/screencast showing how users install your Application, grant permissions, and utilize the scopes you are requesting, so we can experience the user sign-up flow, validate the app services, and then proceed with OAuth Verification process.

返答7: 完了

上記の動画を送ったところ、その二日後に承認された旨の連絡が届いた。

アプリで使うスコープが変更になる場合はOAuth Developer Verification Formから再度申請が必要とのこと。

また、スコープ以外の部分の変更があった場合(リダイレクトURIの変更など)、更新用のフォームから申請が必要とのこと。


Dear Developer,
Thank you for submitting your verification information. Your OAuth Client hogehoge.apps.googleusercontent.com  for Hogehoge has been approved to use the scopes you requested.

https://www.googleapis.com/auth/hogehoge
https://www.googleapis.com/auth/hogehoge

Please note that if you make any changes to the scopes used by your app you may have to submit the verification form again and if you wish to modify some of the information you originally provided, you'll need to submit a verification update form.

Thank you for patience.

申請後のやりとりの雑感

返答が毎回1営業日程度かかるため、今回は申請完了まで1週間程度かかってしまった。
全て事前に気をつけておけば、やりとり自体はかなり短縮できると思われる。

また、今回は再申請だったが、もちろんOAuthを利用するアプリケーションの公開時にも同様の申請が必要になるため、忘れずに行なっておきたい。

備考

アプリケーションによっては、Google認証時にこの画面が表示されるケースがある。
この状態は「詳細」を押すことでGoogle認証自体は行えるが、Googleからの許可が降りていない状況のため、申請が必要となる。

関連リンク

それぞれ場所がわかりにくいためメモしておく。

OAuth Developer Verification Form
https://support.google.com/code/contact/oauth_app_verification

OAuth Developer Verification FormのFAQ
https://support.google.com/googleapi/answer/7394288

OAuth Developer Verification Update Form(変更時のフォーム)
https://support.google.com/code/contact/oauth_app_update

ProjectIDの確認
https://console.cloud.google.com/iam-admin/settings/project

GoogleのAPIの認証情報の確認画面
https://console.cloud.google.com/apis/credentials

OAuthで指定可能なスコープ一覧https://developers.google.com/identity/protocols/googlescopes

Sign-In Branding Guidelines(ログインボタンのブランドガイドライン)
https://developers.google.com/identity/branding-guidelines#top_of_page