-
| 
         It is easy to get an AAD access token via the  As far as I know it is needed to exchange the AAD access token with for an Azure Container Registry refresh token. See ACR docs. Also as far as I know the AAD access token needs to be issued for the  Does the oras-go library support such a token exchange or are there any examples available how to do this? I guess when you have such a refresh token you can just use the StaticCredential like this: client := &auth.Client{
	Client: retry.DefaultClient,
	Cache:  auth.DefaultCache,
	Credential: auth.StaticCredential(registry.Endpoint, auth.Credential{
		RefreshToken: acrRefreshToken,
	}),
} | 
  
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
| 
         Hi @PSanetra, 
 Yes I think the ExchangeAADAccessTokenForACRRefreshToken function provided in  client := &auth.Client{
	Client: retry.DefaultClient,
	Cache:  auth.DefaultCache,
	Credential: auth.StaticCredential(registry.Endpoint, auth.Credential{
		RefreshToken: acrRefreshToken,
	}),
}
 
  | 
  
Beta Was this translation helpful? Give feedback.
Ohhh indeed it is private🫤. It looks like you have to implement the exchange logic on your own since it is out of the scopes of oras-go.
Currently the ACR doc and the ExchangeAADAccessTokenForACRRefreshToken function are the only references that I'm aware of.