Unable to authenticate against the OpenShift internal registry using a token. #43319
Open
Description
opened on Sep 10, 2024
The .NET SDK can't authenticate against the OpenShift image when the auth.json
has an auth
that starts with <token>:
.
This case is treated special here:
The use of the Bearer
scheme is causing the authentication to fail. When I change it to Basic
(that is: removing the special case) then the authentication works.
With podman debug logging, there is a single GET call to the realm uri. I assume it immediately goes for the Basic auth.
DEBU[0000] GET https://<registry>/v2/
DEBU[0000] Ping https://<registry>/v2/ status 401
DEBU[0000] GET https://<registry>/openshift/token?account=%3Ctoken%3E&scope=repository%3Atdeseyn-dev%2Fdotnet-runtime%3Apull
DEBU[0000] Increasing token expiration to: 60 seconds
DEBU[0000] GET https://<registry>/v2/tdeseyn-dev/dotnet-runtime/manifests/8.0
@baronfel can we make the .NET 9 SDK capable of supporting this scenario by also trying basic auth for <token>
? I can work on a PR.
For .NET 10, perhaps we can take a closer look at how docker
and podman
do the auth and try to mimic their behavior?
cc @omajid
Activity