Add audience to token generator

Certain implementations of oauth2, such as auth0, require the audience
parameter to be send to the token generation endpoint.

This commit adds an additional parameter to, by default, send the
audience parameter.

This should be be broadly compatible and ignored by other
implementations. Otherwise, we can consider an additional configuration
option
This commit is contained in:
Addison Higham 2022-02-15 22:55:29 -07:00
parent ddc1e163c4
commit 4ac3d7e568

View File

@ -93,6 +93,9 @@ func NewOidcAuthSetter(baseCfg BaseConfig, cfg OidcClientConfig) *OidcAuthProvid
ClientSecret: cfg.OidcClientSecret, ClientSecret: cfg.OidcClientSecret,
Scopes: []string{cfg.OidcAudience}, Scopes: []string{cfg.OidcAudience},
TokenURL: cfg.OidcTokenEndpointURL, TokenURL: cfg.OidcTokenEndpointURL,
EndpointParams: map[string][]string{
"audience": {cfg.OidcAudience},
},
} }
return &OidcAuthProvider{ return &OidcAuthProvider{