I’m trying to setup NuGet package repository on Community Edition. Documentation here NuGet Repositories implies that it is possible to use API key as a ClearTextPassword field for publishing, however no matter what I try this doesn’t work. Repository Manager always returns 401. If I try a user password instead, everything starts to work. If I use the same API key in my main nuget.config file by setting it via nuget setapikey
it also works. Just not when the key is used as a clear text environment variable.
I have also found this older post Authenticating to NuGet Hosted Repo with Tokens which vaguely confirms that API key for NuGet publishing should work, but doesn’t say in which configuration.
Is this a mistake in the documentation and I must always use nuget setapikey
or am I doing something wrong? I’m now starting to think that’s documentation issue because here NuGet Repositories the variable is named NEXUS_PASSWORD which doesn’t match %NEXUS_API_KEY% in the example configuration above.
Have you enabled the realm as described in the help documentation? NuGet Repositories (link should go to the subsection)
Yes, the realm is enabled. As I said, the API key works in a context of <apiKeys>
nuget.config
configuration option, but doesn’t work “in place” of a password, like documentation suggest it should.
Any more ideas?