Skip to content

Commit

Permalink
store/serverservice/oauth: set AuthStyle to not probe for auth mechan…
Browse files Browse the repository at this point in the history
…isms

This stops the oauth client from having to probe the auth mechanism,
https://cs.opensource.google/go/x/oauth2/+/master:internal/token.go;l=226

in this case the client ID and client token is sent in the request body.
  • Loading branch information
joelrebel committed Aug 11, 2023
1 parent 9cb40ce commit 58f36c8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions internal/store/serverservice.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
"github.com/sirupsen/logrus"
"go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp"
"go.opentelemetry.io/otel"
"golang.org/x/oauth2"
"golang.org/x/oauth2/clientcredentials"

sservice "go.hollow.sh/serverservice/pkg/api/v1"
Expand Down Expand Up @@ -111,6 +112,8 @@ func newClientWithOAuth(ctx context.Context, cfg *app.ServerserviceOptions, logg
TokenURL: provider.Endpoint().TokenURL,
Scopes: cfg.OidcClientScopes,
EndpointParams: url.Values{"audience": []string{cfg.OidcAudienceEndpoint}},
// with this the oauth client spends less time identifying the client grant mechanism.
AuthStyle: oauth2.AuthStyleInParams,
}

// wrap OAuth transport, cookie jar in the retryable client
Expand Down

0 comments on commit 58f36c8

Please sign in to comment.