Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using Personal Access Token with DockerHub APIs #2438

Open
kashifkhan0771 opened this issue Jan 30, 2025 · 0 comments
Open

Using Personal Access Token with DockerHub APIs #2438

kashifkhan0771 opened this issue Jan 30, 2025 · 0 comments

Comments

@kashifkhan0771
Copy link

I was reviewing the DockerHub API documentation, and in the authentication section, it states that both passwords and Personal Access Tokens (PATs) can be used to generate a token for accessing the Hub APIs.

I generated a token using my username and PAT via the endpoint:
🔗 https://hub.docker.com/v2/users/login

However, when I use this token with any documented API, I receive a 403 Forbidden error with the following response:

{
  "message": "token issued from personal access token",
  "errinfo": {}
}

On the other hand, when I use my username and password to generate a token, that token works perfectly with the APIs.

Is this behavior intentional (meaning the documentation is incorrect), or is it a bug?

Additionally, some undocumented endpoints like:
🔗 https://hub.docker.com/v2/orgs/<user_name>
do work with a PAT-generated token, making the authentication flow even more confusing.

Could you clarify this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant