Welcome to the Inedo Forums! Check out the Forums Guide for help getting started.

If you are experiencing any issues with the forum software, please visit the Contact Form on our website and let us know!

Nuget.exe push return 403



  • I am trying to allow our build process to push new builds to our Proget Free instance. I have created a user and given said user the permission to the 'Publish Packages' task. I have also created an api key that grants access to Native API, access to Feed API, and provided said user as the 'Feed API User'. I have then edited the desired feed to use the previously created API key.

    On our build machine I ran two commands to give the previously created user (what I believe) the necessary credentials to publish a package.

    nuget.exe sources add -Name <feed name> -Source <feed source> -Username <username> -Password <password>

    nuget.exe setapikey <key> -Source <feed source>

    So during our automated build process the following command is run:

    nuget.exe push <package> -Source <feed source>

    When this command runs we get a 403 back. Where in my setup have I screwed up?

    Thanks,
    Greg Valainis

    Product: ProGet
    Version: 4.7.14



  • I would remove the "NuGet API Key" from your NuGet feed; that is a seperate thing from "ProGet API Keys", which makes it quite confusing. This is why it will be deprecated in v5.

    You don't need an API key; you can just publish using usename/[password.



  • The task can be accomplished by doing the following:

    1. Do not configure ProGet to use the API key (as stated by Alana)
    2. Do not set user credentials or an API key in nuget.config (ie don't run the nuget.exe add or nuget.exe setapikey commands)
    3. Run the following command:

    nuget.exe push <package> -Source <feed source> -apikey <proget user>:<proget user's password>

    I would not consider this ideal because you can no longer use the built in features of nuget.exe (storing encrypted API keys, passwords, etc). While not ideal, it works so that's something.



  • I agree that this isn't ideal. I'd argue that this basically means ProGet no longer has proper NuGet support.



  • I am not an expert in NuGet so I cannot say if they have 'proper' support.
    I modified our build machine's nuget config via the following command:

    nuget.exe setapikey <proget user>:<proget user's password> -Source <feed source>

    So while I'm not using usernames, passwords, and API keys in the traditional sense, I can still use the built in mechanisms of NuGet to have our build process work seamlessly.



  • You can just go to Admin > API Keys, create a key that works for your NuGet feed.

    This works better for us, because now we can multiple API Keys per feed, and give some of those keys overwrite permissions, instead of just having one "do it all" key...



  • Can you elaborate? I created an API key with Feed API access that takes action on behalf of a user with permission to push packages.

    When I try to use that API key with nuget.exe, I get a 403 failure, and the API key's access log is empty.



  • There's a bug, PG-1211, that will ship in 5.0.9 that should resolve this API Key issue!


Log in to reply
 

Inedo Website HomeSupport HomeCode of ConductForums GuideDocumentation