Add mTLS client certificate authentication support (RFC 8705)#5233
Closed
Add mTLS client certificate authentication support (RFC 8705)#5233
Conversation
|
|
- Add certificate validation logic in object/cert_mtls.go - Add mTLS auth path in AutoSigninFilter (routers/auto_signin_filter.go) - Add client cert extraction helpers in routers/base.go and controllers/token.go - Add tls_client_auth support in ValidateOAuth for RFC 8705 compliance - Add unit tests for certificate validation in object/cert_mtls_test.go Co-authored-by: hsluoyz <3787410+hsluoyz@users.noreply.github.com>
…FromRequest Co-authored-by: hsluoyz <3787410+hsluoyz@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add mTLS client authentication support for enhanced security
Add mTLS client certificate authentication support (RFC 8705)
Mar 7, 2026
941f460 to
9038d8a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds mutual TLS client authentication using
application.Certvalidation in bothAutoSigninFilterand the OAuth token endpoint, per maintainer direction.Changes
object/cert_mtls.go— Core mTLS logic:GetClientCertFromRequest()extracts client cert fromRequest.TLS.PeerCertificatesorX-Client-Certheader (reverse proxy support)GetApplicationByClientCert(clientId, cert)looks up application and validates cert against configured CAverifyClientCertAgainstCACert()usesx509.Verifywith proper chain/expiry/key-usage checksrouters/auto_signin_filter.go— New mTLS auth path: when a TLS client cert is present withclientId(noclientSecret), authenticate via certificate validation againstapplication.Certcontrollers/token.go—ValidateOAuthnow supportstls_client_auth(RFC 8705): client_id + client cert without client_secret triggers mTLS validation at the token endpointobject/cert_mtls_test.go— Tests for CA-signed certs, self-signed certs, wrong-CA rejection, invalid PEM, and expired cert rejectionUsage
A client authenticates by presenting a TLS client certificate and specifying only
clientId:At the token endpoint:
The client certificate is validated against the application's configured
Cert(CA certificate). Both CA-signed and self-signed certificate flows are supported.Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
www.google.com/usr/bin/curl curl www.google.com -o /dev/null --connect-timeout 5 r/runc-log.json 64/compile la/GTS_Root_R1.c/usr/local/go/pkg/tool/linux_amd64/vet y.crt _Root_CA_3.crt 64/compile rtif�� b94c5c0d3/diffma-errorsas b94c5c0d3/diffma-ifaceassert e -e s/,/_/g /usr/bin/grep sed(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.