Google+ ログインを実装した多くのデベロッパーは、コードフローを使用していました。つまり、Android、iOS、または JavaScript アプリが Google から OAuth 認可コードを取得し、クライアントがそのコードをクロスサイト リクエストのなりすまし防止とともにサーバーに送り返します。サーバーはコードを検証し、更新トークンとアクセス トークンを取得して、people.get API からユーザー プロファイル情報を取得します。
そのため、ID トークンをリクエストし、クライアントからサーバーに ID トークンを送信することをおすすめします。ID トークンにはクロスサイト偽造防止機能が組み込まれており、サーバー上で静的に検証することもできます。これにより、Google のサーバーからユーザー プロファイル情報を取得するための追加の API 呼び出しを回避できます。手順に沿ってサーバー上で ID トークンを検証します。
[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["必要な情報がない","missingTheInformationINeed","thumb-down"],["複雑すぎる / 手順が多すぎる","tooComplicatedTooManySteps","thumb-down"],["最新ではない","outOfDate","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["サンプル / コードに問題がある","samplesCodeIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2024-11-09 UTC。"],[[["Google Sign-In for Android is outdated; migrate to Credential Manager for enhanced security and user experience, except for Wear OS 3, 4, and 5.0, which should continue using Google Sign-In for Android until Credential Manager support is available."],["The `profile.emails.read` scope is now sensitive; replace it with the `email` scope and follow provided steps to avoid user disruption and security warnings."],["Google+ Sign-In is fully deprecated; migrate to Google Sign-In and update sign-in elements according to the new branding guidelines."],["For server-side authentication, Google recommends using ID tokens instead of the code flow for better security and efficiency."]]],[]]