{"id":34251968,"url":"https://github.com/primait/jwks_client","last_synced_at":"2025-12-16T10:55:40.366Z","repository":{"id":36953237,"uuid":"422127339","full_name":"primait/jwks_client","owner":"primait","description":"Prima JWKS-sync client implementation for Auth0","archived":false,"fork":false,"pushed_at":"2025-11-27T14:49:24.000Z","size":104,"stargazers_count":10,"open_issues_count":3,"forks_count":4,"subscribers_count":44,"default_branch":"master","last_synced_at":"2025-11-30T07:45:05.596Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/primait.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2021-10-28T08:36:50.000Z","updated_at":"2025-11-27T14:49:27.000Z","dependencies_parsed_at":"2023-01-17T08:00:56.366Z","dependency_job_id":"ff6ad992-ded6-4ab8-a5b2-5e56fc55ded7","html_url":"https://github.com/primait/jwks_client","commit_stats":{"total_commits":44,"total_committers":7,"mean_commits":6.285714285714286,"dds":"0.18181818181818177","last_synced_commit":"49849124784f73e547fe45ead1221815ff92a3bc"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/primait/jwks_client","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/primait%2Fjwks_client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/primait%2Fjwks_client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/primait%2Fjwks_client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/primait%2Fjwks_client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/primait","download_url":"https://codeload.github.com/primait/jwks_client/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/primait%2Fjwks_client/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27763238,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-12-16T02:00:10.477Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2025-12-16T10:55:39.773Z","updated_at":"2025-12-16T10:55:40.359Z","avatar_url":"https://github.com/primait.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JWKS Client\n\nThis lib is used to store Json Web Key Set from your authentication provider. It stores in an internal Cache fetched JWKS\nand automatically refresh them after a given time.\n\n## Installation\n\nAdd to your `Cargo.toml`\n\n```toml\n# Cargo.toml\n[dependencies]\njwks_client_rs = \"0.5.2\"\n```\n\n## Code example\n\n```rust\n// Put in your application context or wherever this can live long enough\nuse jwks_client_rs::source::WebSource;\nuse jwks_client_rs::JwksClient;\n\n// here you must join your `BASE_AUTH0_URL` env var with `.well-known/jwks.json` or whatever is the jwks url\nlet url: reqwest::Url = todo!();\nlet timeout: std::time::Duration = todo!();\n// You can define a different source too using `JwksSource` trait\nlet source: WebSource = WebSource::builder()\n    .with_timeout(timeout)\n    .with_connect_timeout(timeout)\n    .build(url);\n\nlet client: JwksClient\u003cWebSource\u003e = JwksClient::builder()\n    .build(source);\n\n// Store your client in your application context or whatever\n// ..\n\n// Get jwk by kid\nuse jwks_client_rs::{JsonWebKey, JwksClientError};\n\nlet kid: String = todo!();\nlet result: Result\u003cJsonWebKey, JwksClientError\u003e = app_context.jwks_client.get(kid).await;\n```\n\nIt is possible to decode your token validating it has been signed by one of your authentication provider JWKS.\n\n```rust\n#[derive(serde::Deserialize)]\nstruct Claims {\n    aud: String,\n}\n\nlet client: JwksClient = todo!();\n// Here's the token. Remember to remove \"Bearer \" from your token in case it is present\nlet token: \u0026str = todo!();\n// The audience the token were released for.\nlet audience: \u0026str = todo!();\nlet result: Result\u003cClaims, JwksClientError\u003e = client.decode::\u003cClaims\u003e(token, audience).await;\n```\n\n## Example\n\nA working example could be found in [examples](./examples) folder. To run the example:\n- Export the `KID` env variable (take it from your tenant well known jwks)\n- Export the `BASE_AUTH0_URL` (by running [localauth0](https://github.com/primait/localauth0) or using your \n  auth0 tenant; the url should be your localauth0 exposed port on `localhost` or something like \n  `https://{your-tenant}.eu.auth0.com`)\n- Run in shell `cargo run --example get_jwks`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprimait%2Fjwks_client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprimait%2Fjwks_client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprimait%2Fjwks_client/lists"}