docker / hub-feedback

Feedback and bug reports for the Docker Hub
https://hub.docker.com
233 stars 48 forks source link

API login returns Unauthorized with personal access token #2227

Closed keanR1 closed 2 years ago

keanR1 commented 2 years ago

Similar behavior to issue #2166 from Oct 2021: 401 error with API login using personal access token.

From Docker CLI, login works with either password or token.

% docker logout ==> Removing login credentials for https://index.docker.io/v1/ % docker login ==> providing username and main password succeeds % docker logout ==> Removing login credentials for https://index.docker.io/v1/ % docker login ==> providing username and personal access token succeeds

But using curl to post to https://hub.docker.com/v2/users/login, the main password works but the token doesn't.

curl -s -H "Content-Type: application/json" -X POST -d '{"username": "<USERNAME>", "password": "<MAIN_PASSWORD>"}' https://hub.docker.com/v2/users/login/ {"token": "..."}

curl -s -H "Content-Type: application/json" -X POST -d '{"username": "<USERNAME>", "password": "<ACCESS_TOKEN>"}' https://hub.docker.com/v2/users/login/ {"detail": "Incorrect authentication credentials"}

Up until two hours ago, the API login with the personal access token was working. We don't want to store the master password in our CI/CD environment. Thanks for your help.

SaschaBerghaus commented 2 years ago

We are currently experiencing the same problem. Sunday evening the authorization via access token when using curl stopped working. The same access token works fine when using the cli.

technicallyjosh commented 2 years ago

Hey there! Sorry for the slight delay in replying to this. This was fixed earlier today. You should no longer have issues with this. Let us know if the problem still exists for you. 😄