Skip to content

Comments

Fix up ContainerRegistry Authentication for OCI#1949

Open
jborean93 wants to merge 1 commit intoPowerShell:masterfrom
jborean93:oci-auth
Open

Fix up ContainerRegistry Authentication for OCI#1949
jborean93 wants to merge 1 commit intoPowerShell:masterfrom
jborean93:oci-auth

Conversation

@jborean93
Copy link

@jborean93 jborean93 commented Feb 21, 2026

PR Summary

Updates the ContainerRegistry authentication logic to work with OCI compliant registries like ghcr.io. The changes skip using the Azure environment credentials unless the bearer service ends with .azurecr.io as these tokens are only useful for ACR. The Azure AccessToken to Bearer token exchange is also simplified with an unecessary step removed.

A new special prefix is used for the username when a credential represents an Azure AccessToken. This is necessary to ensure that only these specific types of credentials will use the Azure specific steps for authentication.

While this new prefix is technically a breaking change, it isn't documented and seems like it's mostly added for testing. With the new change it is now possible to use a credential that contains the Azure app client id and client secret which was not possible before. I'm happy to talk through this more but it is important that this is fixed before too many people rely on the existing behaviour.

PR Context

Fixes: #1946

PR Checklist

Updates the ContainerRegistry authentication logic to work with OCI
compliant registries like `ghcr.io`. The changes skip using the Azure
environment credentials unless the bearer service ends with
`.azurecr.io` as these tokens are only useful for ACR. The Azure
AccessToken to Bearer token exchange is also simplified with an
unecessary step removed.

A new special prefix is used for the username when a credential
represents an Azure AccessToken. This is necessary to ensure that only
these specific types of credentials will use the Azure specific steps
for authentication.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OCI Authentication Hardcoded for Azure

1 participant