Skip to content

Update OIDC connections to use single-step login-action flow - #25659

Open
gmondello wants to merge 1 commit into
docker:mainfrom
gmondello:update-oidc-single-step-login
Open

Update OIDC connections to use single-step login-action flow#25659
gmondello wants to merge 1 commit into
docker:mainfrom
gmondello:update-oidc-single-step-login

Conversation

@gmondello

@gmondello gmondello commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Summary

docker/login-action v4.5.0+ supports OIDC token exchange natively via the DOCKERHUB_OIDC_CONNECTIONID environment variable, eliminating the need for a separate docker/oidc-action step.

Changes

  • Replace the two-step workflow (docker/oidc-action + docker/login-action) with a single-step docker/login-action flow
  • Use GitHub Actions variables instead of raw placeholders
  • Add a tip about docker/oidc-action for advanced use cases where the token is needed as a separate output
  • Update deactivation/deletion section to remove docker/oidc-action references

Context

@netlify

netlify Bot commented Jul 27, 2026

Copy link
Copy Markdown

Deploy Preview for docsdocker ready!

Name Link
🔨 Latest commit e87ed7e
🔍 Latest deploy log https://app.netlify.com/projects/docsdocker/deploys/6a68c3cd4fdeed0008f5c7b2
😎 Deploy Preview https://deploy-preview-25659--docsdocker.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@gmondello
gmondello marked this pull request as draft July 27, 2026 17:09
@gmondello
gmondello force-pushed the update-oidc-single-step-login branch 2 times, most recently from 7567b7f to 2360ec6 Compare July 27, 2026 17:22
@gmondello
gmondello marked this pull request as ready for review July 28, 2026 13:48

@docker-agent docker-agent left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assessment: 🟡 NEEDS ATTENTION

Comment thread content/manuals/enterprise/security/oidc-connections/create-manage.md Outdated
Comment thread content/manuals/enterprise/security/oidc-connections/create-manage.md Outdated
docker/login-action v4.5.0+ supports OIDC token exchange natively via
the DOCKERHUB_OIDC_CONNECTIONID environment variable, eliminating the
need for a separate docker/oidc-action step.

- Replace two-step workflow (oidc-action + login-action) with single-step
- Use GitHub Actions variables instead of raw placeholders
- Add tip about docker/oidc-action for advanced token-output use cases
- Update deactivation/deletion section to remove oidc-action references
@gmondello
gmondello force-pushed the update-oidc-single-step-login branch from 2360ec6 to e87ed7e Compare July 28, 2026 14:59
@akristen akristen self-assigned this Jul 28, 2026
@akristen akristen added area/enterprise Issue affects Docker Enterprise area/security labels Jul 28, 2026
Comment on lines +53 to +63
jobs:
login:
runs-on: ubuntu-latest
steps:
-
name: Login to Docker Hub
uses: docker/login-action@{{% param "login_action_version" %}}
env:
DOCKERHUB_OIDC_CONNECTIONID: ${{ vars.DOCKERHUB_OIDC_CONNECTIONID }}
with:
username: ${{ vars.DOCKERHUB_ORGANIZATION }}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dotjoshrc Is docker-login action the default way we want to people to use OIDC?


Add the OIDC connection ID and your Docker organization name as
[GitHub Actions variables](https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/store-information-in-variables)
in your repository or organization settings. Then update your workflow:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Docker organization? GitHub repository? IDK what your take is but since both of us share these words, might want to risk some redundancy to specify which we mean. WYT @gmondello

name: Login to Docker Hub
uses: docker/login-action@{{% param "login_action_version" %}}
env:
DOCKERHUB_OIDC_CONNECTIONID: ${{ vars.DOCKERHUB_OIDC_CONNECTIONID }}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just to x2 confirm, meant to be an all caps variable?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nvm intentional, yippee

@docker-agent docker-agent left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assessment: 🟢 APPROVE

The PR replaces the two-step OIDC flow (docker/oidc-action + docker/login-action) with the native single-step docker/login-action v4.5.0+ approach. The changes are accurate, well-scoped, and consistent with the style guide.

What was checked:

  • ✅ Not vendored/generated content
  • ✅ No page removal — no missing redirects needed
  • ✅ Markdown formatting is valid
  • ✅ No AI hedge words or marketing language detected
  • ✅ Scope preserved — update matches existing document character
  • ✅ Workflow YAML correctly uses env: for DOCKERHUB_OIDC_CONNECTIONID (the action reads it from the environment, as designed per login-action PR #1048)
  • with: username: correctly set; password intentionally omitted for OIDC flow
  • ✅ Front matter keywords updated appropriately
  • ✅ Callout syntax (> [!TIP]) is correct

username: ${{ vars.DOCKERHUB_ORGANIZATION }}
```

The `id-token: write` permission lets the workflow request a GitHub OIDC

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a little dense to read as a full paragraph. We can either add this context next to the key/value pairs as code comments for in-line documentation, or maybe use unordered lists? It's fine as is just a little nit lol:

"

  • The workflow requests a GitHub OIDC token with the id-token: write permission.
  • The docker/login-action handles the OIDC token exchange and Docker login in a single step when DOCKERHUB_OIDC_CONNECTIONID is set and password is omitted.
  • The username value must be an organization name. Personal accounts aren't supported.
    "

username: ${{ vars.DOCKERHUB_ORGANIZATION }}
```

The `id-token: write` permission lets the workflow request a GitHub OIDC

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The `id-token: write` permission lets the workflow request a GitHub OIDC
The workflow requests a GitHub OIDC token with the `id-token: write` permission

@akristen akristen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-blocking, and happy to just fast follow with style guide stuff if you're fine with it. Will merge once @gurleensethi-docker gives the 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/enterprise Issue affects Docker Enterprise area/security

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants