Skip to content

Commit b2fc60f

Browse files
committed
Address comments
1 parent 2bdbd3a commit b2fc60f

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

oauth2/auth_suite_test.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,18 @@ type MockGrantProvider struct {
6262
keyFile *KeyFile
6363
}
6464

65-
func (mgp *MockGrantProvider) GetGrant(audience string, _ *ClientCredentialsFlowOptions) (*AuthorizationGrant, error) {
65+
func (mgp *MockGrantProvider) GetGrant(audience string, opts *ClientCredentialsFlowOptions) (*AuthorizationGrant, error) {
66+
scopes := []string{mgp.keyFile.Scope}
67+
if opts != nil && len(opts.AdditionalScopes) > 0 {
68+
scopes = append(scopes, opts.AdditionalScopes...)
69+
}
6670
return &AuthorizationGrant{
6771
Type: GrantTypeClientCredentials,
6872
Audience: audience,
73+
ClientID: mgp.keyFile.ClientID,
6974
ClientCredentials: mgp.keyFile,
7075
TokenEndpoint: oidcEndpoints.TokenEndpoint,
71-
Scopes: []string{mgp.keyFile.Scope},
76+
Scopes: scopes,
7277
}, nil
7378
}
7479

0 commit comments

Comments
 (0)