This article shows you how to configure Identity-Aware Proxy (IAP) to use external identities. By combining IAP and Identity Platform, you can authenticate users with a wide range of identity providers (such as OAuth, SAML, OIDC, and more), instead of just Google accounts.
Enabling and configuring Identity Platform
IAP uses Identity Platform to authenticate external identities. See the Quickstart for Identity Platform to learn how to enable it.
If you want to utilize multiple tenants, you'll also need to follow the steps in Getting started with multi-tenancy. If you don't need to isolate resources, you can skip this step and configure all your providers at the project level. Consult the overview on external identities if you're unsure if you should turn on multi-tenancy.
Finally, you'll need to enable providers. The quickstart shows how to use simple username and password authentication, but Identity Platform supports a wide range of provider types, including:
- Email and password
- OAuth (such as Google, Facebook, Twitter, and more)
- Phone number
See the rest of the Identity Platform documentation to learn how to configure other providers. Note that phone number, anonymous, and custom authentication are not supported for use with multi-tenancy.
Enabling IAP to use external identities
Once you've set up Identity Platform, you can configure IAP to use it for authentication.
Open the IAP page in the Cloud Console.
Open the IAP page
Select the same project that you configured Identity Platform with. Using different projects is not supported.
Select the HTTP Resources tab.
Locate the App Engine app or Compute Engine service you want to restrict access to using IAP.
Toggle the switch in the IAP column to On.
In the side panel, click Start in the box labeled Use external identities for authorization.
Confirm your selection.
In the Identity Platform side panel:
Choose whether to build your own sign-in page, or have IAP create one for you.
Letting IAP create the sign-in page is the fastest way to get started. You don't need to deploy additional services or write any new code, and can specify minor customizations using JSON. See Hosting an authentication UI on Cloud Run to learn more.
Building your own page is more complex, but gives you full control of the authentication flow and experience. See Creating an authentication UI with FirebaseUI and Creating a custom authentication UI for more information.
If you chose to build your own UI, enter an Authentication URL. IAP will redirect unauthenticated requests it receives to this URL.
Including your API key in the URL is optional. If you don't provide a key, the Cloud Console will append your default key automatically.
Select whether to use project providers or tenants.
Check the boxes of the providers or tenants to enable. Select Configure providers if you need to modify your providers or tenants.
Congratulations! IAP is configured to authenticate users with external identities.
Switching back to Google identities
You cannot use IAM for authorization when using external identities. If you want to switch back to Google identities so you can leverage IAM, follow these steps:
Return to the IAP page in the Cloud Console.
Open the IAP page
Select the resource configured to use IAP.
Open the Identity Platform information panel.
Select Use IAM to manage this resource.
Note that switching back to Google identities will clear your authentication URL and associated project and tenants.