cli icon indicating copy to clipboard operation
cli copied to clipboard

🚧 Add support for OAuth device-code login 🚧

Open laurazard opened this issue 1 month ago • 5 comments

- What I did

WIP PR for discussion that adds support for the device-code flow OAuth login, when authenticating against the official registry.

I'll follow up with another PR to explore implementing this at the credential store layer/using a new credential store.

- How I did it

Added cli/internal/oauth, which includes a new OAuthManager that is capable of fulfilling a device-code flow against the official registry.

Fetching credentials remains the same, as the returned access token can be transparently used in place of the password when authenticating.

Login and logout flows now defer to OAuthManager when running against the official registry.

- How to verify it

Run docker login, and check your credentials store to find the stored access tokens. Attempt to do an operation which requires authentication (such as pushing an image to your repo) and verify it works.

- Description for the changelog

Added support for the device-code flow OAuth login, when authenticating against the official registry.

- A picture of a cute animal (not mandatory but encouraged)

Screenshot 2024-07-01 at 13 57 11

laurazard avatar Jul 03 '24 10:07 laurazard