Google Workspace アカウントがなくても、Google 認証を Cloudflare Access に連携できます。この連携では、Google アカウントを持つユーザーなら誰でもログインできます(Access ポリシー がそのリソースへの到達を許可している場合)。Google Workspace の手順とは異なり、以下の手順では Google Workspace アカウントからグループ所属情報を取得できません。
Google を ID プロバイダーとして Cloudflare One に連携するために、Google Cloud Platform の利用者である必要はありません。IdP 連携の設定のために Google Cloud Platform を開くだけで十分です。
-
Google Cloud Platform の コンソール ↗ にログインします。新しいプロジェクトを作成し、名前を付けて Create を選択します。
-
プロジェクトのホームページで APIs & Services を開き、サイドバーで Credentials を選択します。
-
Configure Consent Screen を選択します。
-
同意画面を設定します。
- Get started を選択します。
- App name と User support email を入力します。
- Audience Type は External を選びます。このアプリケーションは Google Workspace アカウント内で作成しないため、Gmail アドレスを持つユーザーなら誰でもログインできます。
- Contact Information を入力します。Google Cloud Platform では、アカウント内のメールアドレスが必要です。
- Google のユーザーデータポリシーに同意し、Continue を選択します。
- Create を選択します。
-
OAuth の概要ページが開きます。OAuth の概要画面で Create OAuth client を選択します。
-
Application type で Web application を選び、OAuth Client ID に名前を付けます。
-
Authorized JavaScript origins の URIs に、チームドメインを入力します。
https://<your-team-name>.cloudflareaccess.comチーム名は、Cloudflare ダッシュボード ↗ の Settings > Team name and domain > Team name で確認できます。
-
Authorized redirect URIs の URIs に、次の URL を入力します。
https://<your-team-name>.cloudflareaccess.com/cdn-cgi/access/callback -
OAuth クライアントを作成したら、作成したばかりの OAuth クライアントを選択します。Google は OAuth Client ID と Client secret を表示します。Client secret はパスワードと同じ扱いなので、共有しないでください。OAuth Client ID と Client secret の両方をコピーします。
-
Cloudflare ダッシュボード ↗ で、Zero Trust > Integrations > Identity providers を開きます。
-
Your identity providers で Add new identity provider を選択します。次のページで Google を選びます。
-
先ほど生成した Client ID(Cloudflare ダッシュボードでは App ID)と Client Secret を入力します。
-
(任意)Proof of Key Exchange (PKCE) ↗ を有効にします。有効にすると、すべてのログイン試行で PKCE が実行されます。
-
Save を選択します。
接続をテストするには、Integrations > Identity providers を開き、Google の横にある Test を選択します。
{
"config": {
"client_id": "<your client id>",
"client_secret": "<your client secret>"
},
"type": "google",
"name": "my example idp"
}Google で OAuth クライアントを削除した(または OAuth クライアントの有効期限が切れた)場合、Error 401: deleted_client という認可エラーが表示されます。
この問題を解消するには、Google ガイドの手順 6 から 12 と、Google Workspace ガイドの手順 9 から 15 を完了します。