Skip to content

Commit 21b69d3

Browse files
authored
Always use mtls token endpoint if certificate is configured (#55)
1 parent d844487 commit 21b69d3

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

internal/oauth2/request.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -164,12 +164,12 @@ func (r *Request) AuthenticateClient(
164164
r.Form.Set("client_assertion", clientAssertion)
165165
case TLSClientAuthMethod, SelfSignedTLSAuthMethod:
166166
r.Form.Set("client_id", cconfig.ClientID)
167-
endpoint = mtlsEndpoint
167+
}
168168

169-
if tr, ok := hc.Transport.(*http.Transport); ok {
170-
if len(tr.TLSClientConfig.Certificates) > 0 {
171-
r.Cert, _ = x509.ParseCertificate(tr.TLSClientConfig.Certificates[0].Certificate[0])
172-
}
169+
if tr, ok := hc.Transport.(*http.Transport); ok {
170+
if len(tr.TLSClientConfig.Certificates) > 0 {
171+
r.Cert, _ = x509.ParseCertificate(tr.TLSClientConfig.Certificates[0].Certificate[0])
172+
endpoint = mtlsEndpoint
173173
}
174174
}
175175

0 commit comments

Comments
 (0)