Skip to content

Commit

Permalink
include client_secret in request to device auth url
Browse files Browse the repository at this point in the history
  • Loading branch information
DrDaveD committed Jul 19, 2021
1 parent 74b7dc8 commit 92b2d28
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion path_oidc.go
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,7 @@ func (b *jwtAuthBackend) authURL(ctx context.Context, req *logical.Request, d *f

values := url.Values {
"client_id": {config.OIDCClientID},
"client_secret": {config.OIDCClientSecret},
"scope": {strings.Join(scopes, " ")},
}
body, err := contactIssuer(caCtx, config.OIDCDeviceAuthURL, &values, false)
Expand All @@ -625,7 +626,7 @@ func (b *jwtAuthBackend) authURL(ctx context.Context, req *logical.Request, d *f
}
err = json.Unmarshal(body, &deviceCode)
if err != nil {
return nil, errwrap.Wrapf("error decoding issuer response to device auth: {{err}}", err)
return nil, fmt.Errorf("error decoding issuer response to device auth: %v; response: %v", err, string(body))
}
// currently hashicorp/cap/oidc.NewRequest requires
// redirectURL to be non-empty so throw in place holder
Expand Down

0 comments on commit 92b2d28

Please sign in to comment.