[Enhancement] Add support authenticate with identityToken when use CredentialProvider
Hi,
Docker API has 2 ways to authenticate which is user/pass and identity token.
Docker auth document: https://docs.docker.com/engine/api/v1.43/#section/Authentication
When docker cli store identity token in secret store, it will store usename as <token> and store identity token in secret. Currently testcontainer use these value directly, which cause authentication error because of wrong username.
why This use when pull image from private registry such as azure container registry and github registry
Solution
Check if username is <token>, then authenticate with identity token instead of user/pass.
There is already this feature in testcontainer-dotnet. Implementation in testcontainer-dotnet
I did some POC in this PR https://github.com/ptantanis/testcontainers-node/pull/1