dkregistry-rs icon indicating copy to clipboard operation
dkregistry-rs copied to clipboard

Add support for authenticating against Azure Container Registry

Open ThorstenHans opened this issue 1 year ago • 3 comments

As described in #262 Azure Container Registry returns the access token using the access_token field instead of the token field. With this commit, the token could be fetched from both fields

ThorstenHans avatar Feb 28 '24 19:02 ThorstenHans

Upon further testing I discovered that Docker Hub returns both fields token and access_token in the response. I know that the name of the added struct (AzureBearerAuth) is not optimal. But using an intermediate struct allowed me to successfully authenticate against both Docker Hub and ACR.

ThorstenHans avatar Feb 28 '24 21:02 ThorstenHans

cc @PratikMahajan

vrutkovs avatar Feb 28 '24 21:02 vrutkovs

Renamed the struct from AzureBearerAuth to MultiTokenBearerAuth which is a bit more meaningful

ThorstenHans avatar Feb 28 '24 21:02 ThorstenHans