Skip to content

Commit b41fe54

Browse files
committed
set grant type to correct refresh token
1 parent 03d8000 commit b41fe54

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

session.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,11 +213,13 @@ func (s *Session) init(config *configv3.Config, configUaa *configv3.Config, conf
213213
"username": config.CFUsername(),
214214
"password": config.CFPassword(),
215215
}, "", constant.GrantTypePassword)
216+
config.SetUAAGrantType(string(constant.GrantTypePassword))
216217
} else if config.UAAOAuthClient() != "cf" {
217218
accessToken, refreshToken, err = uaaClient.Authenticate(map[string]string{
218219
"client_id": config.UAAOAuthClient(),
219220
"client_secret": config.UAAOAuthClientSecret(),
220221
}, "", constant.GrantTypeClientCredentials)
222+
config.SetUAAGrantType(string(constant.GrantTypeClientCredentials))
221223
}
222224
if err != nil {
223225
return fmt.Errorf("Error when authenticate on cf: %s", err)
@@ -261,11 +263,13 @@ func (s *Session) init(config *configv3.Config, configUaa *configv3.Config, conf
261263
"username": config.CFUsername(),
262264
"password": config.CFPassword(),
263265
}, "", constant.GrantTypePassword)
266+
configUaa.SetUAAGrantType(string(constant.GrantTypePassword))
264267
} else {
265268
accessTokenSess, refreshTokenSess, err = uaaClientSess.Authenticate(map[string]string{
266269
"client_id": configUaa.UAAOAuthClient(),
267270
"client_secret": configUaa.UAAOAuthClientSecret(),
268271
}, "", constant.GrantTypeClientCredentials)
272+
configUaa.SetUAAGrantType(string(constant.GrantTypeClientCredentials))
269273
}
270274

271275
if err != nil {

0 commit comments

Comments
 (0)