Docker Hub API authorization issues

I’m trying to use the /v2/access-tokens API documented here Docker Hub API reference, but I’m encountering authorization issues.

When I make a GET request to https://hub.docker.com/v2/access-tokens using a valid Docker personal access token (PAT) as the Bearer token, I receive a 401 Unauthorized response.

After reviewing the documentation, I saw that the API expects a JWT. So I used the /v2/users/login/ endpoint, passing my Docker username and PAT as the password, to retrieve a JWT. However, when I use that JWT to call the same access-tokens endpoint, I get a 403 Forbidden with the message:
“token issued from personal access token is not allowed.”

Am I misunderstanding the authentication flow for this endpoint?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.