Unable to authenticate against the OpenShift internal registry using a token. #43319
Labels
Area-CLI
Area-Containers
Related to dotnet SDK containers functionality
untriaged
Request triage from a team member
The .NET SDK can't authenticate against the OpenShift image when the
auth.json
has anauth
that starts with<token>:
.This case is treated special here:
sdk/src/Containers/Microsoft.NET.Build.Containers/AuthHandshakeMessageHandler.cs
Lines 321 to 323 in 3390aa4
The use of the
Bearer
scheme is causing the authentication to fail. When I change it toBasic
(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.
@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
andpodman
do the auth and try to mimic their behavior?cc @omajid
The text was updated successfully, but these errors were encountered: