Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add authentication for custom nuget repositories #74

Open
eladavron opened this issue Jan 22, 2024 · 3 comments
Open

Add authentication for custom nuget repositories #74

eladavron opened this issue Jan 22, 2024 · 3 comments
Labels

Comments

@eladavron
Copy link

Either I've completely missed this or this feature currently isn't available.
I wanted to add a custom nuget repository (something we use internally in the company) but I couldn't find a way to add authentication, which is required by this repository.
Please add this, it will be very useful.

@maraf
Copy link
Member

maraf commented Jan 23, 2024

That is something missing in UI. PR would be welcome.

In the meantime, you should be able to bypass it if you

a) Modify directly nuget.config for Plugin Manager C:\Users\USER\AppData\Local\GitExtensions\UserPlugins\NuGet.Config

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageSources>
    <add key="nuget" value="https://api.nuget.org/v3/index.json" />

    <!-- New source -->
    <add key="github" value="https://nuget.pkg.github.com/NAMESPACE/index.json" />
  </packageSources>

  <!-- Crendentials for new source -->
  <packageSourceCredentials>
    <github>
        <add key="Username" value="USERNAME" />
        <add key="ClearTextPassword" value="PASSWORD" />
      </github>
  </packageSourceCredentials>
</configuration>

b) Use dotnet CLI to do the same thing

dotnet nuget add source --username USERNAME --password PASSWORD --store-password-in-clear-text --name github "https://nuget.pkg.github.com/NAMESPACE/index.json" --configfile C:\Users\USER\AppData\Local\GitExtensions\UserPlugins\NuGet.Config

I haven't actually tried them because I don't have a feed with auth at hand, but these are valid nuget options and Plugin Manager is using the same mechanics, so they should work

@maraf maraf added type: feature New feature or request area: package manager labels Jan 23, 2024
@eladavron
Copy link
Author

eladavron commented Jan 23, 2024

I tried that but it throws this error:

image

Despite it working correctly on Postman with same credentials.
Tried with non-cleartext password too, same error.

I suspect it may be using the wrong authentication method when doing the POST?

@maraf
Copy link
Member

maraf commented Jan 23, 2024

Sorry, I don't have any idea without digging deeper.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants