Prepare and test your skills

Prepare and test your skills

Free sample question with answers and detailed explanation below. The Professional Cloud Developer practice bank has an additional 608 practice questions.Try 10 free realistic questions: instant score, no credit card, and no account required.
You are building a multi-tenant B2B SaaS application with a backend API deployed on Cloud Run. The application must meet the following requirements:
Authorization header of API requests to the Cloud Run backend.Which authentication and token verification strategy should you implement?
TenantAwareAuth) with revocation checking enabled.Identity Platform is Google Cloud's enterprise customer identity and access management (CIAM) service. Multi-tenancy allows you to create isolated silos—called tenants—within a single project, where each tenant maintains its own user pool, identity provider configurations, and quotas. When a user signs in, Identity Platform issues a signed OIDC-compliant JSON Web Token (JWT) ID token that asserts the user's identity and tenant context.
Authorization: Bearer header lets the Cloud Run service verify who is making the call.TenantAwareAuth, accessed via authForTenant(tenantId)) with checkRevoked set to true verifies the cryptographic signature, confirms the firebase.tenant claim matches the expected tenant, and checks token revocation against that tenant's specific user pool.TenantAwareAuth queries the exact tenant user record to enforce revokeRefreshTokens calls.This approach directly separates authentication from resource authorization by using a verifiable OIDC ID token rather than repurposing an upstream OAuth 2.0 access token, while leveraging Identity Platform's enterprise multi-tenancy and tenant-scoped revocation checks.
Identity-Aware Proxy (IAP) provides a central authorization layer that authenticates requests before they reach your application. By default, IAP relies on Google identities (Google Workspace or Cloud Identity accounts) and Cloud IAM roles. Meanwhile, the OAuth 2.0 client credentials grant allows an application to obtain an access token on its own behalf using a client ID and client secret, without an end user.
You were securing an internal corporate application on Cloud Run accessed exclusively by employees with Google Workspace accounts managed through Cloud IAM.
If you choose to use IAP with external B2B users, IAP must be explicitly configured with Identity Platform external identities, and your backend still inspects the ID token claims rather than relying on Cloud IAM roles.
verifyIdToken method with checkRevoked set to true.Firebase Authentication is built on top of Identity Platform's backend, but it is tailored for consumer applications and exposes only a subset of enterprise features. Operating at the project level stores all authenticated users in a single shared user pool without tenant boundaries.
verifyIdToken(idToken, true) with checkRevoked enabled only inspects the root project's user pool and fails with a user-not-found error for users belonging to a tenant.checkRevoked is false, but cannot check revocation status for tenant-scoped accounts.You were building a single-tenant consumer application using standard social or email/password logins without B2B isolation or enterprise SAML/OIDC federation requirements.
To enable revocation checking in a multi-tenant architecture, you must instantiate a tenant-aware client (authForTenant) for the target tenantId rather than relying on the project-level authentication client.
Authorization header to Cloud Run, and decode the access token on the backend to authorize tenant access.An OAuth 2.0 access token is a credential issued by an authorization server to grant a client application limited permissions (scopes) to access protected resources on a specific resource server (such as a third-party API). It represents delegated authorization rather than a standardized assertion of user identity for your own backend.
tenantId or project-specific uid needed to verify tenant membership.verifyIdToken revocation check on an arbitrary upstream OAuth 2.0 access token.iss, sub, and aud), OAuth 2.0 access tokens have no mandated internal format.The frontend or backend needed to call an external third-party API (such as a customer's cloud storage or calendar API) on behalf of the user using delegated OAuth 2.0 scopes, rather than authenticating the user to your own Cloud Run backend.
A common misconception is treating OAuth 2.0 access tokens and OIDC ID tokens as interchangeable. Always send ID tokens to verify user identity on your backend and reserve access tokens for calling the APIs that issued them.
Answer them yourself and get your score the moment you finish. No account needed.
Full access includes
Keep the momentum going with these hand-picked practice scenarios
Last updated Validated