[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

Assigned QA: Maria Pogozelits
Sprint: Leap 31, Leap 32


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 Sun Oct 20 12:37:59 UTC 2019 using JIRA 7.6.16#76018-sha1:9ed376192612a49536ac834c64177a0fed6290f5.