Skip to content

Commit cae069c

Browse files
authored
allow auth scopes from provisioner
1 parent c216086 commit cae069c

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

utils/cautils/token_generator.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,13 @@ func generateOIDCToken(ctx *cli.Context, p *provisioner.OIDC) (string, error) {
124124
args := []string{"oauth", "--oidc", "--bare",
125125
"--provider", p.ConfigurationEndpoint,
126126
"--client-id", p.ClientID, "--client-secret", p.ClientSecret}
127-
if len(p.AuthParams) > 0 {
127+
if len(p.Scopes) != 0 {
128+
for _, keyval := range p.Scopes {
129+
args = append(args, "--scope")
130+
args = append(args, keyval)
131+
}
132+
}
133+
if len(p.AuthParams) != 0 {
128134
for _, keyval := range p.AuthParams {
129135
args = append(args, "--auth-param")
130136
args = append(args, keyval)

0 commit comments

Comments
 (0)