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

Audit Logs API - Forbidden When Using PAT Authentication #2367

Open
obelisk opened this issue Jan 19, 2024 · 2 comments
Open

Audit Logs API - Forbidden When Using PAT Authentication #2367

obelisk opened this issue Jan 19, 2024 · 2 comments

Comments

@obelisk
Copy link

obelisk commented Jan 19, 2024

Problem description

Audit Logs API - Forbidden When Using PAT Authentication

I've done the standard login and gotten a JWT to use, but calling the auditlogs API returns an unhelpful:

{"message":"forbidden","errinfo":{}}

I've tried all different permission levels for PATs but none seem to give me a token that is accepted. We cannot use username and password authentication due to enforcement of SSO. Am I missing something obvious to make this work?

@davidr-bt
Copy link

@obelisk We discovered the following after having the identical experience:

  • the requesting dockerhub user must be an owner;
  • if the request is programatic, the user must either have 2fa disabled or else handle 2fa programatically (there's an associated API call);
  • the user must log in with its associated password, and not with the alternative login technique of using a user-generated API token instead of the password;
  • the login returns a session token: this is the token to be used in the auditlog request.

After banging our heads against the wall for a while, we discovered that this works.

@azxqw
Copy link

azxqw commented Aug 27, 2024

@davidr-bt Do you mean that I have to use the user's password and not a PAT?

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

3 participants