{"id":30269386,"url":"https://github.com/ocarinow/fastjwt","last_synced_at":"2025-08-16T02:02:47.225Z","repository":{"id":125392355,"uuid":"608727363","full_name":"ocarinow/fastjwt","owner":"ocarinow","description":"FastAPI Plugin for reusable JWT Authentication Management","archived":false,"fork":false,"pushed_at":"2024-03-08T02:24:59.000Z","size":874,"stargazers_count":8,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-08T10:55:38.932Z","etag":null,"topics":["fastapi","jwt","jwt-authentication","python"],"latest_commit_sha":null,"homepage":"https://ocarinow.github.io/fastjwt/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ocarinow.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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,"zenodo":null}},"created_at":"2023-03-02T16:03:52.000Z","updated_at":"2024-05-23T17:52:52.000Z","dependencies_parsed_at":null,"dependency_job_id":"382e5f44-c4e3-443a-8b5b-0d179af0074b","html_url":"https://github.com/ocarinow/fastjwt","commit_stats":{"total_commits":111,"total_committers":3,"mean_commits":37.0,"dds":0.036036036036036,"last_synced_commit":"507821175f8ea471d2f37ce57fbce4a98c0a8472"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/ocarinow/fastjwt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ocarinow%2Ffastjwt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ocarinow%2Ffastjwt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ocarinow%2Ffastjwt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ocarinow%2Ffastjwt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ocarinow","download_url":"https://codeload.github.com/ocarinow/fastjwt/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ocarinow%2Ffastjwt/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270657705,"owners_count":24623464,"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-08-16T02:00:11.002Z","response_time":91,"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":["fastapi","jwt","jwt-authentication","python"],"created_at":"2025-08-16T02:01:24.783Z","updated_at":"2025-08-16T02:02:47.203Z","avatar_url":"https://github.com/ocarinow.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fastjwt\n\u003c!-- Base badges --\u003e\n\u003cp style=\"text-align:center;\"\u003e\n    \u003ca href=\"https://github.com/ocarinow/fastjwt\"\u003e\n        \u003cimg src=\"https://img.shields.io/pypi/pyversions/fastjwt\" alt=\"Supported Python Version\" /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://pypi.org/project/fastjwt\"\u003e\n        \u003cimg src=\"https://img.shields.io/pypi/v/fastjwt\" alt=\"Package Version\" /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/ocarinow/fastjwt/blob/main/LICENSE\"\u003e\n        \u003cimg src=\"https://img.shields.io/github/license/ocarinow/fastjwt\" alt=\"Licence\" /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://ocarinow.github.io/fastjwt/\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/docs-available-brightgreen\" alt=\"Documentation\"\u003e\u003c/img\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\u003c!-- GitHub Action badges --\u003e\n\u003cp style=\"text-align:center;\"\u003e\n    \u003ca href=\"https://github.com/ocarinow/fastjwt/actions\" alt=\"Build Status\"\u003e\n        \u003cimg src=\"https://github.com/ocarinow/fastjwt/actions/workflows/cicd-release.yaml/badge.svg\" alt=\"Build Status\" /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/ocarinow/fastjwt/actions\" alt=\"Test Status\"\u003e\n        \u003cimg src=\"https://github.com/ocarinow/fastjwt/actions/workflows/cicd-test.yaml/badge.svg\" alt=\"Test Status\" /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/ocarinow/fastjwt/actions\" alt=\"Publish Status\"\u003e\n        \u003cimg src=\"https://github.com/ocarinow/fastjwt/actions/workflows/cicd-publish.yaml/badge.svg\" alt=\"Publish Status\" /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/ocarinow/fastjwt/actions\" alt=\"Publish Status\"\u003e\n        \u003cimg src=\"https://github.com/ocarinow/fastjwt/actions/workflows/cicd-documentation.yaml/badge.svg\" alt=\"Documentation Status\" /\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\u003c!-- Code quality badges --\u003e\n\u003cp style=\"text-align:center;\"\u003e\n    \u003ca href=\"https://github.com/ocarinow/fastjwt/actions\"\u003e\n        \u003cimg src=\"https://raw.githubusercontent.com/ocarinow/fastjwt/main/docs/badges/coverage.svg\" alt=\"Coverage\" /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/ocarinow/fastjwt/actions\"\u003e\n        \u003cimg src=\"https://raw.githubusercontent.com/ocarinow/fastjwt/main/docs/badges/pytest.svg\" alt=\"Tests\" /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/ocarinow/fastjwt/actions\"\u003e\n        \u003cimg src=\"https://raw.githubusercontent.com/ocarinow/fastjwt/main/docs/badges/interrogate.svg\" alt=\"Docstring\" /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/ocarinow/fastjwt/actions\"\u003e\n        \u003cimg src=\"https://raw.githubusercontent.com/ocarinow/fastjwt/main/docs/badges/flake8.svg\" alt=\"Flake8\" /\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\u003c!-- Activity badges --\u003e\n\u003cp style=\"text-align:center;\"\u003e\n    \u003ca href=\"https://github.com/ocarinow/fastjwt\"\u003e\n        \u003cimg src=\"https://img.shields.io/github/issues/ocarinow/fastjwt\" alt=\"Issues\" /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/ocarinow/fastjwt\"\u003e\n        \u003cimg src=\"https://img.shields.io/github/issues-pr/ocarinow/fastjwt\" alt=\"Pull Requests\" /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/ocarinow/fastjwt\"\u003e\n        \u003cimg src=\"https://img.shields.io/github/repo-size/ocarinow/fastjwt\" alt=\"Repo Size\" /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/ocarinow/fastjwt\"\u003e\n        \u003cimg src=\"https://img.shields.io/pypi/dm/fastjwt\" alt=\"Downloads\" /\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\u003c!-- Community badges --\u003e\n\u003cp style=\"text-align:center;\"\u003e\n    \u003ca href=\"https://github.com/ocarinow/fastjwt/stargazers\" alt=\"Stars\"\u003e\n        \u003cimg src=\"https://img.shields.io/github/stars/ocarinow/fastjwt?style=social\" alt=\"Stars\" /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/ocarinow/fastjwt\" alt=\"Forks\"\u003e\n        \u003cimg src=\"https://img.shields.io/github/forks/ocarinow/fastjwt?style=social\" alt=\"Forks\" /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/ocarinow/fastjwt/watchers\" alt=\"Watchers\"\u003e\n        \u003cimg src=\"https://img.shields.io/github/watchers/ocarinow/fastjwt?style=social\" alt=\"Watchers\" /\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\nFastJWT is a FastAPI Plugin for reusable JWT Authentication Management. **fastjwt** enables easy JSON Web Tokens management within your FastAPI application.\n\n_fastjwt_ is heavily inspired from its Flask equivalent [Flask-JWT-Extended](https://flask-jwt-extended.readthedocs.io/en/stable/), _special thanks to [@vimalloc](https://github.com/vimalloc) fot the amazing work_.\n\n**Documentation**: [https://ocarinow.github.io/fastjwt/](https://ocarinow.github.io/fastjwt/)\n\n## Features\n\n- [X] Encode/Decode JWT for application Authentication\n- [X] Automatic JWT detection in request\n  - [X] JWT in Headers\n  - [X] JWT in Cookies\n  - [X] JWT in Query strings\n  - [X] JWT in JSON Body\n- [X] Implicit/Explicit token refresh mechanism\n- [X] Freshness state of token\n- [X] Route protection\n  - [X] Token type based protection _(access/refresh)_\n  - [X] Token freshness protection\n  - [X] Partial route protection\n- [X] Handle custom user logic for revoked token validation\n- [X] Handle custom logic for token recipient retrieval _(ORM, pydantic serialization...)_\n- [X] Provide FastAPI compliant dependency injection API\n- [X] Automatic error handling\n- [ ] Scope Management (WIP)\n\n## Setup\n\n### Requirements\n\nFastJWT is built on top of the following dependencies:\n\n- [FastAPI](https://github.com/tiangolo/fastapi) as web framework\n- [Pydantic](https://github.com/pydantic/pydantic) as data validation\n- [PyJWT](https://github.com/jpadilla/pyjwt) as python implementation of the JSON Web Token standard\n\nFastJWT also relies on [`typing-extensions`](https://pypi.org/project/typing-extensions/) for backward compatibility _(python3.9)_\n\n\u003e Note\n\u003e\n\u003e FastAPI, while required for **fastjwt**, is not declared as a dependency and must be installed prior with `pip install fastapi`\n\n### Install\n\n```shell\n# With pip\npip install fastjwt\n# With poetry\npoetry add fastjwt\n# With pipenv\npipenv install fastjwt\n```\n\n## Example\n\n```py\nfrom fastapi import FastAPI, Depends\nfrom fastjwt import FastJWT\n\napp = FastAPI()\nsecurity = FastJWT()\n\n@app.get('/login')\ndef login():\n    return security.create_access_token(uid='foo')\n\n@app.get('/protected', dependencies=[Depends(security.access_token_required())])\ndef protected():\n    return \"This is a protected endpoint\"\n```\n\n## Development\n\n\u003e \u003cspan style=\"color:orange;\"\u003e**WORK IN PROGRESS**\u003c/span\u003e\n\u003e\n\u003e The development guide is not available yet\n\n## Contributing\n\n\u003e \u003cspan style=\"color:orange;\"\u003e**WORK IN PROGRESS**\u003c/span\u003e\n\u003e\n\u003e The contribution guide is not available yet\n\n## License\n\nThis project is open source under [MIT License](https://github.com/ocarinow/fastjwt/blob/main/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Focarinow%2Ffastjwt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Focarinow%2Ffastjwt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Focarinow%2Ffastjwt/lists"}