Skip to content

NuGet push returns 401 (Unauthorized) when using --api-key #20717

@A9G-Data-Droid

Description

@A9G-Data-Droid

Description

I created an organization with my main account. I can use my account to push nuget packages in to the repository for my organization. Then I generated an API token using the GUI, saved that to my password manager. I've been having trouble using that token.

When I run this command:

dotnet nuget push --source gitea {package_file} --api-key {gitea_token}

The response is:

error: Response status code does not indicate success: 401 (Unauthorized).

Gitea Version

Gitea Version: 1.17.0

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

2022/08/04 14:59:45 ...kages/nuget/nuget.go:25:apiError() [E] [62ec4151-12] context canceled

Screenshots

No response

Git Version

git version 2.31.1

Operating System

Operating System: Red Hat Enterprise Linux 8.6 (Ootpa) CPE OS Name: cpe:/o:redhat:enterprise_linux:8::baseos Kernel: Linux 4.18.0-372.16.1.el8_6.x86_64

How are you running Gitea?

Installed from binary, running as a service.

Database

PostgreSQL

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic/packagestype/featureCompletely new functionality. Can only be merged if feature freeze is not active.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions