All posts

How to configure Cloud Run OIDC for secure, repeatable access

You finally get your Cloud Run service deployed, only to realize half your internal apps can’t reach it without juggling service accounts, tokens, or credentials that quietly expire on weekends. This is the moment you discover the magic behind Cloud Run OIDC. Cloud Run handles running containers on Google Cloud without servers to babysit. OIDC, OpenID Connect, solves identity and access in a federated, standards-based way. When you combine them, you get a modern pattern: services verifying each

Free White Paper

VNC Secure Access + Protocol Translation (SAML to OIDC): The Complete Guide

Architecture patterns, implementation strategies, and security best practices. Delivered to your inbox.

Free. No spam. Unsubscribe anytime.

You finally get your Cloud Run service deployed, only to realize half your internal apps can’t reach it without juggling service accounts, tokens, or credentials that quietly expire on weekends. This is the moment you discover the magic behind Cloud Run OIDC.

Cloud Run handles running containers on Google Cloud without servers to babysit. OIDC, OpenID Connect, solves identity and access in a federated, standards-based way. When you combine them, you get a modern pattern: services verifying each other’s identities automatically without hardcoded secrets. That makes your access both secure and scalable, two words that rarely appear in the same sentence.

At a high level, Cloud Run OIDC works by having Cloud Run issue ID tokens that confirm who is calling. Another service, API, or gateway validates those tokens using Google’s public keys. The flow proves identity and intent, not just possession of a key. It’s the trust handshake portion of zero-trust networking in miniature.

Integration workflow
Here’s the mental model.

  1. A private service on Cloud Run requests another service using the service URL.
  2. The caller uses its Cloud Run runtime identity or a bound service account to mint an OIDC token.
  3. The receiving service validates that token against the identity provider, confirming claims like aud and iss.
  4. Authorization logic decides whether the caller is allowed to act.

No long-lived credentials, no “shared secrets in comments” from 2014.

Quick answer (Snippet-ready):
Cloud Run OIDC lets one Cloud Run service call another using short-lived, identity-bound tokens instead of static credentials, improving security and simplifying authentication across environments.

Continue reading? Get the full guide.

VNC Secure Access + Protocol Translation (SAML to OIDC): Architecture Patterns & Best Practices

Free. No spam. Unsubscribe anytime.

Best practices

  • Rotate service account keys out of existence. Let runtime identities issue OIDC tokens dynamically.
  • Always check the aud claim to prevent token reuse across services.
  • Align IAM roles closely with request scope. Principle of least privilege still applies.
  • Log token validation outcomes for audit traces that make SOC 2 reviews less painful.

Benefits

  • No more manual credential management across pipelines.
  • Reduced attack surface from hardcoded secrets.
  • Clear traceability of who called what, and when.
  • Faster onboarding with policies defined once per identity.
  • Predictable permission flows your security team can actually understand.

Developer experience
When Cloud Run OIDC is set up correctly, developers stop waiting on infrastructure to grant token access. Deployments ship faster because “who can talk to what” is managed through identity, not environment variables. The team gains confidence, and debug logs stop reading like mystery novels.

Platforms like hoop.dev extend this pattern even further, turning those identity checks into runtime guardrails. They watch traffic through your Cloud Run services, apply policy continuously, and integrate cleanly with providers like Okta or AWS IAM—perfect for teams standardizing zero-trust controls without slowing down deployments.

How do I connect OIDC with external services?
Use workload identity federation to let other clouds or CI systems (like GitHub Actions) mint OIDC tokens trusted by Google Cloud. That removes static credentials entirely while preserving auditability.

How do I test Cloud Run OIDC locally?
You can simulate OIDC flows with signed JWTs from a test identity provider, but keep real validation logic unchanged. The closer your local tests mimic the real token verification, the fewer surprises post-deploy.

Cloud Run OIDC turns what used to be a mess of service accounts and secrets into a short conversation between verified identities. Once you see that flow in motion, you stop writing “temporary” token hacks forever.

See an Environment Agnostic Identity-Aware Proxy in action with hoop.dev. Deploy it, connect your identity provider, and watch it protect your endpoints everywhere—live in minutes.

Get started

See hoop.dev in action

One gateway for every database, container, and AI agent. Deploy in minutes.

Get a demoMore posts