Skip to content

Commit

Permalink
passed request can also be introspection request
Browse files Browse the repository at this point in the history
  • Loading branch information
Johannes Koch authored and johakoch committed Jan 31, 2024
1 parent 4290777 commit 11a5849
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions oauth2/authenticator.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,14 +137,14 @@ func NewClientAuthenticator(evalCtx *hcl.EvalContext, authMethod *string, endpoi
}

// Authenticate authenticates an OAuth2 token or introspection request by adding necessary form parameters/header fields.
func (ca *ClientAuthenticator) Authenticate(formParams *url.Values, tokenReq *http.Request) error {
func (ca *ClientAuthenticator) Authenticate(formParams *url.Values, req *http.Request) error {
if ca == nil {
return nil
}

switch ca.authnMethod {
case clientSecretBasic:
tokenReq.SetBasicAuth(url.QueryEscape(ca.clientID), url.QueryEscape(ca.clientSecret))
req.SetBasicAuth(url.QueryEscape(ca.clientID), url.QueryEscape(ca.clientSecret))
case clientSecretPost:
formParams.Set("client_id", ca.clientID)
formParams.Set("client_secret", ca.clientSecret)
Expand Down

0 comments on commit 11a5849

Please sign in to comment.