Set auth style when no client secret in use (#1289)

Co-authored-by: Hidetake Iwata <int128@gmail.com>
This commit is contained in:
Karolína Lišková
2025-11-23 06:43:21 +00:00
committed by GitHub
parent 1ead2a405e
commit 5d091e486a

View File

@@ -62,11 +62,17 @@ func (f *Factory) New(ctx context.Context, prov oidc.Provider, tlsClientConfig t
if err != nil {
return nil, fmt.Errorf("could not determine supported PKCE methods: %w", err)
}
endpoint := provider.Endpoint()
if prov.ClientSecret == "" {
endpoint.AuthStyle = oauth2.AuthStyleInParams
}
return &client{
httpClient: httpClient,
provider: provider,
oauth2Config: oauth2.Config{
Endpoint: provider.Endpoint(),
Endpoint: endpoint,
ClientID: prov.ClientID,
ClientSecret: prov.ClientSecret,
RedirectURL: prov.RedirectURL,