OIDC and Keyless Authentication
What You'll Learn
You'll learn how to use OpenID Connect (OIDC) to authenticate GitHub Actions workflows to cloud providers without storing long-lived credentials.
The Security Problem with Stored Credentials
Traditionally, authenticating to cloud providers (AWS, Azure, GCP) from CI/CD pipelines required storing long-lived credentials as secrets—like access keys or service account tokens. These credentials:
- Never expire automatically
- Pose a security risk if leaked
- Require manual rotation
- Have broad permissions that can't easily be scoped to individual workflow runs
How OIDC Changes the Game
OpenID Connect provides keyless authentication through short-lived tokens. Instead of storing credentials, GitHub Actions can request a temporary identity token that proves "this workflow run, from this repository, triggered by this event" is making the request.
Analogy: Rather than giving your friend a permanent key to your house (long-lived credential), you install a smart lock that generates one-time entry codes that expire after 15 minutes (OIDC tokens).
How It Works
- Your GitHub Actions workflow requests an OIDC token from GitHub
- The token contains claims about the workflow (repository, branch, job, etc.)
- Your cloud provider validates the token against GitHub's public keys
- The cloud provider issues temporary credentials based on trust policies you've configured
- The workflow uses those credentials for the duration of the job
The cloud provider trusts GitHub's token because you've configured it to accept tokens with specific claims (like "only from this repository" or "only from the main branch").
Key Takeaway: OIDC enables secure, keyless authentication by replacing long-lived stored credentials with short-lived tokens that are automatically issued based on workflow identity and validated by cloud providers.