PHP 5 はサポートが終了しており、2026 年 1 月 31 日に
非推奨になります。非推奨になると、過去に組織のポリシーを使用して以前のランタイムのデプロイを再度有効にしていた場合でも、PHP 5 アプリケーションをデプロイできなくなります。既存の PHP 5 アプリケーションは、
非推奨になる日付以降も引き続き実行され、トラフィックを受信します。
サポートされている最新バージョンの PHP に移行することをおすすめします。
ユーザーの認証
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
Google Cloud アプリケーションでユーザーを認証するには、次の方法があります。
認証サービス |
目的 |
Firebase Authentication |
Google、Facebook、Twitter など、複数のユーザー認証オプションを提供します。維持するコードを最小限に抑えつつ、最大数のユーザーをサポートします。 |
Google ログイン |
Google ログインは、Gmail や Google Workspace アカウントのログインを提供し、ワンタイム パスワード(OTP)もサポートします。既存のログイン システムの中では、Google 専用アカウントまたは Google アカウントをサポートするうえで最も簡単な方法です。 |
OAuth 2.0 と OpenID Connect |
OpenID Connect を使用すると、大部分のカスタマイズで最初から認証トークンを処理し、使用できます。 |
Google Cloud Identity Platform |
Identity Platform は、Identity and Access Management 機能を自社アプリケーションに組み込むための顧客 ID とアクセス管理(CIAM)プラットフォームです。このオプションは、独自の ID プロバイダを使用するユーザーに最適です。 |
Users API |
Users API は、Google アカウントと Google Workspace アカウントの認証に使用される以前のバンドル サービスの 1 つです。この組み込み API は App Engine でのみ使用できます。 |
Identity-Aware Proxy(IAP) |
IAP を使用すると、リクエストがアプリケーション リソースに到達する前に、App Engine サービスへのアクセスを制御できます。IAP を使用すると、アプリケーションの一元的な認可レイヤを確立し、署名済みヘッダーまたは App Engine Users API と連携してアプリを保護できます。この表にある他の認証サービスとは異なり、IAP は、アプリに到達する前に認証を実行します。このページの他のオプションでは、アプリに認証を実装します。 |
Firebase Authentication
Firebase Authentication は、ユーザーが使用したいすべてのアカウントでのログインをサポートする堅牢で安全性の高いオールインワン認証システムを提供します。Google、Facebook、Twitter などのソーシャル ログイン連携に加えて、パスワード認証にも対応しているため、デスクトップやモバイルでのアプリの成長に応じて、認証システムを簡単にスケーリングできます。
Firebase Authentication は、Google App Engine アプリに対し最も簡単にユーザー認証を設定する方法です。Firebase Authentication についての詳細は、以下をご覧ください。
Google ログイン
ウェブサイトやアプリに Google ログインボタンを表示する場合や、ドメインに Google 管理コンソールを使用し、そのログイン情報に基づいてユーザーを認証する場合には、Google ログインを使用できます。これは、OAuth 2.0 と OpenID Connect プロトコル対応の Google ログイン クライアント ライブラリです。
Google ログインはウェブアプリ、iOS、Android で利用できます。
OAuth 2.0 と OpenID Connect
Google ログインは Google による OAuth 2.0 実装がベースであり、OpenID Connect 仕様に準拠し、OpenID Certified を受けています。
OpenID Connect は OAuth 2.0 プロトコルの上にある ID レイヤで、アプリでこれを使用してユーザー プロフィール情報を取得できます。
Identity Platform は、ユーザーの登録とログインを管理するカスタマイズ可能なドロップイン ID と認証サービスを提供します。Identity Platform は、さまざまな認証方法(SAML、OIDC、メールアドレスとパスワード、ソーシャル、電話、カスタム認証)に幅広く対応し、あらゆる ID ソリューションと統合できる柔軟性を備えています。Identity Platform は、Google Cloudのグローバル スケール、パフォーマンス、ネットワーク、セキュリティを基盤に構築されており、ほぼすべてのアプリやサービスの要求に応えるよう、エンタープライズ グレードのサポートと SLA を提供します。
Identity Platform は独自のユーザー ID システムを提供します。ドメインですでに Google Workspace を使用していて、そのログインに基づいてユーザーを認証する場合は、Google ログインを使用する必要があります。
Identity Platform と App Engine の統合については、App Engine でのユーザーのログインに関する入門ガイドをご覧ください。
Users API
Users API で、アプリケーションは次のタスクを実行できます。
- 現在のユーザーのログイン状況を検出します。
- 適切なログインページにユーザーをリダイレクトします。
- ユーザーが新しい Google アカウントをまだ作成していない場合、ユーザーにそれを作成するよう要求します。
ユーザーがアプリケーションにログイン済みのときは、アプリケーションがユーザーのメールアドレスにアクセスできます。アプリケーションは現在のユーザーが管理者かどうかを判断することもできるので、アプリケーションの管理者専用ページを簡単に実装できます。
詳細については、Users API の概要をご覧ください。
Identity-Aware Proxy(IAP)
IAP では、着信する外部リクエストに対し、リソースの前に認証と認可のレイヤを追加してアプリケーションを保護します。IAP は、同じプロジェクト内の別の App Engine サービスなど、プロジェクト内のアクティビティから保護することはありません。アプリへのアクセスが承認されていないユーザーには、App Engine アプリへのアクセス権限はありません。
IAP で保護されたサービスまたはアプリケーションにアクセスできるのは、適切な Identity and Access Management(IAM)ロールを持つプリンシパルのみです。ユーザーが IAP で保護されたリソースにアクセスしようとすると、IAP が認証と認可のチェックを行います。IAP でアプリケーション リソースを保護する方法については、IAP の概要をご覧ください。
IAP は、アプリ全体に対して有効にすることも、アプリの特定のサービスまたはバージョンに対して有効にすることもできます。App Engine リソース用に IAP を構成する方法については、IAP のクイックスタートをご覧ください。
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-09-04 UTC。
[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["わかりにくい","hardToUnderstand","thumb-down"],["情報またはサンプルコードが不正確","incorrectInformationOrSampleCode","thumb-down"],["必要な情報 / サンプルがない","missingTheInformationSamplesINeed","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2025-09-04 UTC。"],[[["\u003cp\u003eGoogle Cloud offers multiple authentication methods for applications, including Firebase Authentication, Google Sign-In, OAuth 2.0/OpenID Connect, Identity Platform, Users API, and Identity-Aware Proxy (IAP).\u003c/p\u003e\n"],["\u003cp\u003eFirebase Authentication provides a comprehensive system for user sign-in with various methods, including Google, Facebook, Twitter, and password authentication, and is the easiest to use for a Google App Engine app.\u003c/p\u003e\n"],["\u003cp\u003eGoogle Sign-In supports Gmail and Google Workspace account sign-in, including one-time passwords (OTP), and is the simplest option for Google-only accounts or integrating Google accounts into existing systems.\u003c/p\u003e\n"],["\u003cp\u003eIdentity Platform is a customer identity and access management (CIAM) solution that provides flexible authentication options, allowing organizations to manage their own identity and access management for their apps.\u003c/p\u003e\n"],["\u003cp\u003eIdentity-Aware Proxy (IAP) acts as a security layer by performing authentication and authorization checks before external requests can reach App Engine services, ensuring only authorized users can access the app.\u003c/p\u003e\n"]]],[],null,["# Authenticating Users\n\nTo authenticate users in Google Cloud applications, Google offers the following\nmethods:\n\nFirebase Authentication\n-----------------------\n\n[Firebase Authentication](https://firebase.google.com/docs/auth/) gives you a\nrobust, secure authentication system-in-a-box that helps you do sign in with any\naccount your users want to use. Firebase Authentication supports password\nauthentication in addition to federated sign-in with Google, Facebook, Twitter,\nand more, allowing you to easily scale your authentication system as you grow on\ndesktop and mobile.\n\nFirebase Authentication is the easiest way to set up user authentication for a\nGoogle App Engine app. To learn more about Firebase Authentication, try the\nfollowing:\n\n- [Firebase Web Tutorial](https://codelabs.developers.google.com/codelabs/firebase-web/)\n highlights how to use Firebase on a website, including user sign-in with Google\n as the Identity Provider.\n\n- [Firebase Quickstart Apps](https://firebase.google.com/docs/samples/) show\n how to integrate Firebase across platforms, using both federated sign-in and\n username/password sign-in examples. Samples demonstrate Firebase Authentication\n using the [JavaScript SDK](https://github.com/firebase/quickstart-js/tree/master/auth)\n as well as on [iOS](https://github.com/firebase/quickstart-ios/tree/master/authentication)\n and [Android](https://github.com/firebase/quickstart-android/tree/master/auth).\n\nGoogle Sign-In\n--------------\n\nIf you want to provide a Google login button for your website or app, or you're\nusing Google Admin console for your domain and you want to authenticate users based\non that login, you can use [Google Sign-in](https://developers.google.com/identity/),\nwhich is our sign-in client library built on the OAuth 2.0 and OpenID Connect\nprotocols.\n\nGoogle Sign-In is available for\n[Web Apps](https://developers.google.com/identity/gsi/web/guides/overview),\n[iOS](https://developers.google.com/identity/sign-in/ios/),\nand [Android](https://developers.google.com/identity/sign-in/android/).\n\nOAuth 2.0 and OpenID Connect\n----------------------------\n\nGoogle Sign-in is based on Google's OAuth 2.0 implementation,\nwhich conforms to the [OpenID Connect specification](http://openid.net/connect/),\nand is [OpenID Certified](http://openid.net/certification/).\n\nOpenID Connect is an identity layer on top of the OAuth 2.0 protocol, and your\napp can use it to [retrieve user profile information](https://developers.google.com/identity/protocols/OpenIDConnect#obtaininguserprofileinformation).\n\nIdentity Platform\n-----------------\n\n[Identity Platform](https://cloud.google.com/identity-platform) provides a drop-in,\ncustomizable identity and authentication service for user sign-up and sign-in.\nIdentity Platform supports multiple authentication methods (SAML, OIDC,\nemail/password, social, phone, and custom auth) to provide flexible integration\noptions for any identity solution. Identity Platform is built on\nGoogle Cloud's global scale, performance, network, and security, and comes with\nan enterprise-grade support and SLA to meet the demands of virtually any app or\nservice.\n\nIdentity Platform offers its own user identity system. If you're already using\nGoogle Workspace for your domain and want to authenticate users based on that\nlogin, you should use [Google Sign-In](#google_sign-in).\n\nTo learn about integrating Identity Platform with App Engine, try the\nhow-to guide for [signing in users on\nApp Engine](https://cloud.google.com/identity-platform/docs/web/app-engine).\n\nUsers API\n---------\n\nThe Users API allows an application to perform the following tasks:\n\n- Detect whether the current user is signed in.\n- Redirect the user to the appropriate sign-in page to sign in.\n- Request the user create a new Google account if they don't have one already.\n\nWhile a user is signed in to the application, the app can access the user's\nemail address. The app can also detect whether the current user is an\nadministrator, making it easy to implement admin-only areas of the app.\n\nMore information is available on the [Users API overview](../users).\n\nIdentity-Aware Proxy (IAP)\n--------------------------\n\nIAP protects and secures your application by adding an\nauthentication and authorization layer in front of your resources, for\ninbound external requests. IAP doesn't protect against activity\nwithin a project, such as another App Engine service inside the same\nproject. Users who are not authorized access to your app can't have access to\nreach your App Engine app.\n\nIAP-protected services or applications, can only be accessed by [principals](/iam/docs/overview#concepts_related_identity)\nwhich have the correct [Identity and Access Management (IAM) role](/iam/docs/understanding-roles).\nWhen a user tries to access an IAP-secured resource, IAP\nperforms authentication and authorization checks for you. Learn how\nIAP secures your application resources on the [IAP overview](/iap/docs/concepts-overview).\n\nYou can enable IAP for your whole app, or for specific services\nor versions of your app. See the [IAP quickstart](/iap/docs/authenticate-users-google-accounts)\nto learn how to configure IAP for your App Engine\nresources."]]