pcislo / vscode-nuget-gallery

MIT License
61 stars 19 forks source link

Github package sources #89

Closed bsaranga closed 3 months ago

bsaranga commented 2 years ago

How do I configure a Github package source?

I have tried the following two options:

1.{"name": "github", "url": "https://nuget.pkg.github.com/bsaranga/index.json", "packageSourceCredentials": { "username": "username", "clearTextPassword": "pw"}}

  1. {"name": "github", "url": "https://nuget.pkg.github.com/bsaranga/index.json", "authorizationHeader": "Basic _"}

Both doesn't seem to work.

pcislo commented 1 year ago

For authentication purposes, Credential Provider should be used. Make sure it's located in the folder, that was defined in setttings.

jobou363 commented 1 year ago

Hi, i also have some problems adding source also an using the Credential Provider with this king of feed configuration :

{"name": "My Secure Feed","url": "https://nuget.sample.com/"}

the credential look to be well configured : %UserProfile%/.nuget/plugins/netcore/CredentialProvider.Microsoft

Is there a simple way to use credential provider with the nuget gallery? I have tried bunch of things but cannot get it work.

I get this error message that is probably related to my source config. Is there a more detail message somewhere. Nothing is shown in the console log.

image

I have figured out that the nuget galley tool exec dotnet.exe so I have tried with the following parameters and it give me the following error This credential provider must be run under the Team Build tasks for NuGet.

dotnet C:\Users\username.nuget\plugins\netcore\CredentialProvider.Microsoft\CredentialProvider.Microsoft.dll -C -F Json -U https://nuget.sample.com/ -V 0 -RedactPassword

[Verbose] [CredentialProvider]VstsBuildTaskServiceEndpointCredentialProvider - This credential provider must be run under the Team Build tasks for NuGet with external endpoint credentials. Appropriate environment variable needs to be set. [Verbose] [CredentialProvider]Skipping NuGetCredentialProvider.CredentialProviders.VstsBuildTaskServiceEndpoint.VstsBuildTaskServiceEndpointCredentialProvider, cannot provide credentials for https://....

Snechko commented 1 year ago

Hi, I'm also having trouble adding packages from private sources. I installed the credential provider in the right folder and added endpoints for it as environment variables:

{"endpointCredentials": [{"endpoint":"http://example.index.json", "username":"optional", "password":"accesstoken"}]}

However, it is unclear if I should then add the source inside the extension settings.

image

Can you please help with this issue?

terryaney commented 7 months ago

I had success doing the environment variable and also adding nuget gallery source. I was hoping it would just use the credential manager and prompt for creds, but the only way I got it to work was using the environment variable you've described above.

alvahtin commented 6 months ago

How can I make this work for gthub? I set the environment variable VSS_NUGET_EXTERNAL_FEED_ENDPOINTS="{\"endpointCredentials\": [\"endpoint\":\"https://nuget.pkg.github.com/MY_NAMESPACE/index.json\", \"username\":\"MY_USER_NAME\", \"password\":\"MY_PAT\"]}"

But it doesn't work ((

pcislo commented 4 months ago

The new version should have fixed it. Let me know if any help is still needed here.

goors commented 1 month ago

Same here. I have VSS_NUGET_EXTERNAL_FEED_ENDPOINTS but when feed is selected it shows not packages.