{"id":22268155,"url":"https://github.com/curityio/mutual-tls-api-example","last_synced_at":"2026-04-27T23:39:28.020Z","repository":{"id":74437570,"uuid":"407071591","full_name":"curityio/mutual-tls-api-example","owner":"curityio","description":"An example API using Mutual TLS and Certificate-Bound Access Tokens (RFC8705)","archived":false,"fork":false,"pushed_at":"2023-12-12T08:46:20.000Z","size":81,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2026-01-14T05:59:41.780Z","etag":null,"topics":["api","code-example","financial-grade","jwt","nginx","proof-of-possession","zero-trust"],"latest_commit_sha":null,"homepage":"https://curity.io/resources/learn/mutual-tls-api/","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/curityio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-09-16T07:45:26.000Z","updated_at":"2024-08-01T15:35:40.000Z","dependencies_parsed_at":"2024-12-03T11:11:51.280Z","dependency_job_id":"f21d40af-0ed8-4976-acaa-f9e8717ccdca","html_url":"https://github.com/curityio/mutual-tls-api-example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/curityio/mutual-tls-api-example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/curityio%2Fmutual-tls-api-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/curityio%2Fmutual-tls-api-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/curityio%2Fmutual-tls-api-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/curityio%2Fmutual-tls-api-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/curityio","download_url":"https://codeload.github.com/curityio/mutual-tls-api-example/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/curityio%2Fmutual-tls-api-example/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32360116,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-27T20:07:02.737Z","status":"ssl_error","status_checked_at":"2026-04-27T20:07:00.910Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","code-example","financial-grade","jwt","nginx","proof-of-possession","zero-trust"],"created_at":"2024-12-03T11:11:42.394Z","updated_at":"2026-04-27T23:39:28.006Z","avatar_url":"https://github.com/curityio.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Mutual TLS Secured API Code Example\n\n[![Quality](https://img.shields.io/badge/quality-experiment-red)](https://curity.io/resources/code-examples/status/)\n[![Availability](https://img.shields.io/badge/availability-source-blue)](https://curity.io/resources/code-examples/status/)\n\nA code example to demonstrate Mutual TLS infrastructure and use of certificate bound access tokens.\n\n## B2B APIs\n\nMutual TLS is commonly used for APIs between business partners, including in Open Banking setups:\n\n![Sequence](images/sequence.png)\n\n## Walkthrough\n\nThe [Mutual TLS API Code Example Article](https://curity.io/resources/learn/mutual-tls-api/) explains the technical behavior and setup.\n\n## Quick Start\n\nFirst create certificates for testing:\n\n```bash\n./1-create-certs.sh\n```\n\nThen build the code:\n\n```bash\n./2-build.sh\n```\n\nThen deploy the Mutual TLS endpoints:\n\n```bash\n./3-deploy.sh\n```\n\nThen authenticate via Mutual TLS and call the API over a Mutual TLS channel:\n\n```bash\n./4-run-client.sh\n```\n\nFor troubleshooting view the logs by running one or more of the following commands:\n\n```bash\n./5-view-logs.sh api\n./5-view-logs.sh identity-server\n./5-view-logs.sh reverse-proxy\n```\n\n## Security Workflow\n\nThe code example enables the security workflow to be easily run on a development computer:\n\n### Client Behavior\n\n- The client authenticates using the OAuth Client Credentials Grant with a Client Certiticate credential\n- The client then receives an opaque access token and sends it to the API, using Mutual TLS and the token\n\n### Reverse Proxy and Mutual TLS Termination\n\n- For OAuth requests the Mutual TLS verification is done by the Curity Identity Server\n- For API requests the Mutual TLS verification is done by the reverse proxy\n\n### Curity Identity Server\n\n- A dedicated endpoint is used for Mutual TLS connections, which avoids impacting other clients\n- Access tokens are issued with a `cnf` claim containing the SHA256 thumbprint of the client's certificate\n\n### Certificate Bound Token Verification\n\n- During API requests the reverse proxy introspects the opaque token from the client to get the token in JWT format\n- The reverse proxy then verifies that the JWT's `cnf` claim matches the thumbprint of the request's client certificate\n\n## Teardown\n\nOnce you're done testing out the solution run\n\n```bash\n./6-teardown.sh\n```\n\nto remove all the project's containers.\n\n## More Information\n\nPlease visit [curity.io](https://curity.io/) for more information about the Curity Identity Server.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcurityio%2Fmutual-tls-api-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcurityio%2Fmutual-tls-api-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcurityio%2Fmutual-tls-api-example/lists"}