Skip to content

Commit 51f4c98

Browse files
committed
oauth2: allow override of grant_type
1 parent 5dab416 commit 51f4c98

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

clientcredentials/clientcredentials.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,9 @@ func (c *tokenSource) Token() (*oauth2.Token, error) {
9090
v.Set("scope", strings.Join(c.conf.Scopes, " "))
9191
}
9292
for k, p := range c.conf.EndpointParams {
93-
if _, ok := v[k]; ok {
93+
// Allow grant_type to be overridden to allow interoperability with
94+
// non-compliant implementations.
95+
if _, ok := v[k]; ok && k != "grant_type" {
9496
return nil, fmt.Errorf("oauth2: cannot overwrite parameter %q", k)
9597
}
9698
v[k] = p

0 commit comments

Comments
 (0)