liveBook · Manning

Openid connect

As explained in GitHub Actions in Action: Continuous integration and delivery for DevOps

OpenID Connect is an identity layer built on OAuth 2.0 that enables clients to verify user identity and obtain basic profile claims.

OpenID Connect (OIDC) lets a GitHub Actions deployment workflow request a short-lived access token from its cloud provider instead of presenting a long-lived cloud credential copied into GitHub secrets. It relies on a trust relationship between the provider and the repository that runs the workflow. section 9.3.2 section 9.3.3

When the workflow runs, it authenticates using execution context such as its organization, repository, workflow, or branch. After the OIDC handshake, the workflow exchanges its OIDC token, typically a JWT, for credentials that can perform the deployment. This removes the recurring operational risk of expired, rotated, or duplicated deployment secrets. section 9.3.3 section 9.3.2

Enable OIDC for a deployment workflow in three parts:

  • Create a provider-side trust relationship that identifies the GitHub repository allowed to access the target cloud resources. section 9.3.3
  • Grant id-token: write at workflow or job scope so the workflow can complete the OIDC handshake and request its JWT. section 9.3.3
  • Use the cloud provider’s official authentication action to exchange the OIDC token for a cloud access token, then run deployment commands. section 9.3.3
permissions:
   id-token: write

The required permission may be placed at workflow or job level; give only the scope needed by the deployment. section 9.3.3

AWS deployment workflow

An AWS workflow grants id-token: write, checks out the repository, and uses aws-actions/configure-aws-credentials to assume a configured role before copying index.html to an S3 bucket. The role trust relationship is established outside the workflow YAML. section 9.3.3

OIDC support is required on the cloud-provider side; supported providers include AWS, Azure, Google Cloud Platform, and HashiCorp Vault. Configure trust narrowly: allowing every GitHub repository to deploy to cloud resources creates unnecessary exposure. For cloud deployments, OIDC is presented as the safer alternative to token-based authentication. section 9.3.3 section 9.4

How GitHub Actions in Action: Continuous integration and delivery for DevOps covers it

How deep it goes
Explains trust setup, id-token permissions, JWT exchange, and provider-action YAML while deferring provider-side trust configuration.
Examples
Demonstrates Azure login, AWS role assumption and S3 upload, and Google Cloud authentication followed by gcloud commands.
What it assumes
Assumes a GitHub repository, deployment workflow, cloud resources, and provider-side ability to configure a trust relationship.
What you can do after
Apply it via provider authentication actions to deploy from GitHub Actions using short-lived cloud credentials.
How it connects
Connects GitHub Actions workflows with cloud providers, JWTs, secrets, permissions, deployment environments, and release artifacts.

Also explained in

Compare how 13 books explain openid connect →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of GitHub Actions in Action: Continuous integration and delivery for DevOps. The section links point to the parts of the book it draws on.