Skip to content

Commit 1cc1224

Browse files
committed
tokenmgr: added scope as config option
1 parent e99dff0 commit 1cc1224

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

utils/tokenmanagement.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ type config struct {
5555
ClientSecret string `mapstructure:"client_secret"`
5656
Timeout int64 `mapstructure:"timeout"`
5757
Insecure bool `mapstructure:"insecure"`
58+
Scope string `mapstructure:"scope"`
5859
}
5960

6061
// InitAPITokenManager initializes a new APITokenManager.
@@ -98,6 +99,7 @@ func (a *APITokenManager) getAPIToken(ctx context.Context) (string, time.Time, e
9899
params := url.Values{
99100
"grant_type": {"client_credentials"},
100101
"audience": {a.conf.TargetAPI},
102+
"scope": {a.conf.Scope},
101103
}
102104

103105
httpReq, err := http.NewRequest(http.MethodPost, a.conf.OIDCTokenEndpoint, strings.NewReader(params.Encode()))

0 commit comments

Comments
 (0)