mirror of https://github.com/docker/compose.git
Merge pull request #517 from docker/acr_fix
Acr : do not require refresh token, and work fine with Service Principal Login
This commit is contained in:
commit
92025607c7
|
@ -150,11 +150,10 @@ func (c cliRegistryHelper) autoLoginAcr(registry string) error {
|
|||
}
|
||||
|
||||
data := url.Values{
|
||||
"grant_type": {"access_token_refresh_token"},
|
||||
"service": {registry},
|
||||
"tenant": {tenantID},
|
||||
"refresh_token": {token.RefreshToken},
|
||||
"access_token": {token.AccessToken},
|
||||
"grant_type": {"access_token"},
|
||||
"service": {registry},
|
||||
"tenant": {tenantID},
|
||||
"access_token": {token.AccessToken},
|
||||
}
|
||||
repoAuthURL := fmt.Sprintf("https://%s/oauth2/exchange", registry)
|
||||
res, err := http.Post(repoAuthURL, "application/x-www-form-urlencoded", strings.NewReader(data.Encode()))
|
||||
|
@ -162,7 +161,7 @@ func (c cliRegistryHelper) autoLoginAcr(registry string) error {
|
|||
return err
|
||||
}
|
||||
if res.StatusCode != 200 {
|
||||
return errors.Errorf("error while renewing access token, status : %s", res.Status)
|
||||
return errors.Errorf("error while accessing ACR token from Azure login, status : %s", res.Status)
|
||||
}
|
||||
bits, err := ioutil.ReadAll(res.Body)
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in New Issue