Welcome to the Inedo Forums! Check out the Forums Guide for help getting started.

If you are experiencing any issues with the forum software, please visit the Contact Form on our website and let us know!

NuGet Basic Authentication support



  • 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).



  • I apologize.
    The issue was with the IIS configuration.
    We've enabled the Basic authentication for the ProGet application and the basic authentication is now possible.
    The only minor note is that the realm had to be included for the username - e.g. REALM\user for the username to be resolved.

    TLDR; ProGet already supports Basic authentication for NuGet.


  • inedo-engineer

    @jan-primozic_9264 thanks for posting the update!

    Please let us know if you can see a place for us to improve documentation :)


Log in to reply
 

Inedo Website HomeSupport HomeCode of ConductForums GuideDocumentation