[RTFACT-13905] Nuget Apikey does not work for "nuget list" Created: 15/Mar/17  Updated: 18/Oct/18  Resolved: 10/Jun/18

Status: Resolved
Project: Artifactory Binary Repository
Component/s: NuGet
Affects Version/s: 5.1.3
Fix Version/s: 6.1.0

Type: Documentation Priority: Normal
Reporter: Joshua Han Assignee: Matan Gotlieb
Resolution: Fixed Votes: 2
Labels: None


This jira is for information only.

Nuget Apikey does not work for some nuget commands like "nuget list". This is not a bug on Artifactory, but it is how it is designed in nuget client.

According to Nuget (https://docs.microsoft.com/en-us/nuget/tools/nuget-exe-cli-reference), the APIKey is only supported for a few commands like 'nuget push'. Artifactory knows how to consume the API Key when the nuget client sends it. However, Artifactory cannot use the key if the nuget client does not send it.

For the commands that the nuget client does not use Apikey for (e.g. nuget list), you can use the Package Source Credentials instead, as described in this document: https://www.jfrog.com/confluence/display/RTF/NuGet+Repositories#NuGetRepositories-WorkingWithoutAnonymousAccess

Comment by Jim Baldwin [ 03/Apr/17 ]

Any updates on this issue?

Comment by Nihal Reddy Chinna Choudhary [ 01/May/18 ]

The "Set me Up" feature in Artifactory needs to be updated for Nuget repositories by removing "nuget setapikey <usrrname>:<API KEY>" option. This is not working for nuget cli commands.

Instead we could add an option like this which works and the Nuget.config file gets created with the right format "nuget sources add -Name ArtTest -Source http://<server_name>/artifactory/api/nuget/<repo_name> -username <username> -password <API Key>"


Comment by Will Sullivan [ 18/Oct/18 ]

Why this problem is marked as solved?

I use Artifactory in version 6.2.0 and Nuget CLI version

If I have configured my nuget repository with NON anonymous access, I can push packages, but I can't list packages.

So the description (https://www.jfrog.com/confluence/display/RTF/NuGet+Repositories#NuGetRepositories-WorkingWithoutAnonymousAccess) is not true.

Comment by Will Sullivan [ 18/Oct/18 ]

OK, understand...

If you configured your Artifactory global with anonymous access and set only a few repos to this permission level (https://jfrog.com/knowledge-base/how-can-i-allow-anonymous-user-access-to-specific-repositories-only/), you must set "Force Authentication" to nuget repos that are not in the anonymous list.

Generated at Mon Jun 01 20:47:46 UTC 2020 using Jira 8.5.3#805003-sha1:b4933e02eaff29a49114274fe59e1f99d9d963d7.