How do I authenticate to NuGet?

how i fixed my authorisation problem with secure nugget feed providers

How do I authenticate to NuGet?


Interactive authentication option

  1. install the credential provider
wget -qO- | bash

this will place the nuget configuration here: /home/<user>/.nuget

  1. restore packages interactively
dotnet restore --interactive  (will now ask you to do a device login)

this will prompt you for a device login flow

Configuration file option

Configure the nuget.config file as follows:

placeholder $NUGET_UID} is a user login and ${NUGET_PWD} is an associated PAT which has access to packages

<?xml version="1.0" encoding="utf-8"?>
    <add key="repositoryPath" value=".\packages" />
    <add key="" value="" />
    <add key=" roslyn" value="" />
    <add key="my-custom-production" value="https:<something>/nuget/v3/index.json" />
      <add key="Username" value="${NUGET_UID}" />
      <add key="ClearTextPassword" value="${NUGET_PWD}" />