Our dotnet application is built inside a docker image (FROM mcr.microsoft.com/dotnet/sdk:5.0).
This works great when building a Windows image, but we are trying to migrate to Linux. Sadly the Linux docker image does not support NTLM authentication - the error reported is:
Determining projects to restore...
/usr/share/dotnet/sdk/5.0.405/NuGet.targets(131,5): error : Unable to load the service index for source https://proget.internalserver.com/nuget/internal-nuget/v3/index.json. [/source/ExternalHttpDemo.csproj]
/usr/share/dotnet/sdk/5.0.405/NuGet.targets(131,5): error : GSSAPI operation failed with error - An unsupported mechanism was requested. NTLM authentication requires the GSSAPI plugin 'gss-ntlmssp'. [/source/ExternalHttpDemo.csproj]
The command '/bin/sh -c dotnet restore' returned a non-zero code: 1
I have tried to change the NuGet configuration to require basic authentication:
<add key="ValidAuthenticationTypes" value="basic" />
But this has no effect. The authentication does not succeed:
Determining projects to restore...
/usr/share/dotnet/sdk/5.0.405/NuGet.targets(131,5): error : Unable to load the service index for source https://proget.internalserver.com/nuget/internal-nuget/v3/index.json. [/source/ExternalHttpDemo.csproj]
/usr/share/dotnet/sdk/5.0.405/NuGet.targets(131,5): error : Response status code does not indicate success: 401 (Unauthorized). [/source/ExternalHttpDemo.csproj]
The command '/bin/sh -c dotnet restore' returned a non-zero code: 1
I have checked the request/response from ProGet:
Request: GET https://proget.internalserver.com/nuget/internal-nuget/v3/index.json HTTP/1.1
Relevant response headers:
WWW-Authenticate: Negotiate
WWW-Authenticate: NTLM
I assume that nuget does not attempt the basic authentication, as the returned supported authentication types are only Negotiate and NTLM.
Could you please add support for the basic authentication?
(I cannot be sure if nuget will properly use it if available, but I am hopeful, as the NTLM works ok - as long as the system supports it).