{"id":23712,"library":"fastapi-jwt-auth","title":"FastAPI JWT Auth","description":"FastAPI extension that provides JWT Auth support. Current version is 0.5.0, release cadence is irregular. It supports access/refresh tokens, token freshness, denylist/revocation, WebSocket authorization, and configurable JWT claims.","status":"active","version":"0.5.0","language":"python","source_language":"en","source_url":"https://github.com/IndominusByte/fastapi-jwt-auth","tags":["fastapi","jwt","authentication","authorization"],"install":[{"cmd":"pip install fastapi-jwt-auth","lang":"bash","label":"Latest version"}],"dependencies":[{"reason":"Core dependency, as this is a FastAPI extension","package":"fastapi","optional":false},{"reason":"Used for configuration settings","package":"pydantic","optional":false},{"reason":"JWT encoding/decoding","package":"PyJWT","optional":false}],"imports":[{"note":"AuthJWT is exported at package level, not from submodule","wrong":"from fastapi_jwt_auth.auth import AuthJWT","symbol":"AuthJWT","correct":"from fastapi_jwt_auth import AuthJWT"},{"note":"AuthJWTBearer is exported from package, not from bearer submodule","wrong":"from fastapi_jwt_auth.bearer import AuthJWTBearer","symbol":"AuthJWTBearer","correct":"from fastapi_jwt_auth import AuthJWTBearer"}],"quickstart":{"code":"from fastapi import FastAPI, Depends\nfrom fastapi_jwt_auth import AuthJWT\nfrom pydantic import BaseModel\n\napp = FastAPI()\n\nclass Settings(BaseModel):\n    authjwt_secret_key: str = \"secret\"\n\n@AuthJWT.load_config\ndef get_config():\n    return Settings()\n\n@app.post(\"/login\")\ndef login(auth: AuthJWT = Depends()):\n    access_token = auth.create_access_token(subject=\"test\")\n    return {\"access_token\": access_token}\n\n@app.get(\"/protected\")\ndef protected(auth: AuthJWT = Depends()):\n    auth.jwt_required()\n    current_user = auth.get_jwt_subject()\n    return {\"user\": current_user}","lang":"python","description":"Minimal FastAPI app with JWT authentication using fastapi-jwt-auth."},"warnings":[{"fix":"Use `get_jwt_subject()` instead of `get_jwt_identity()`.","message":"In v0.3.0, `get_jwt_identity()` was renamed to `get_jwt_subject()`. The old name no longer works.","severity":"breaking","affected_versions":">=0.3.0"},{"fix":"Use `@AuthJWT.load_config` decorator instead of `@AuthJWT.load_end`.","message":"In v0.3.0, `load_end()` was renamed to `load_config()`. The old name no longer works.","severity":"breaking","affected_versions":">=0.3.0"},{"fix":"Replace any 'blacklist' references with 'denylist' (e.g., `denylist_enabled`, `denylist_token_verifier`).","message":"In v0.3.0, `blacklist` was renamed to `denylist`. All functions and configuration referring to 'blacklist' are deprecated and removed.","severity":"breaking","affected_versions":">=0.3.0"},{"fix":"Always use `Depends()` to inject AuthJWT into your route handler.","message":"The `create_access_token` and `get_jti` functions must be called from inside a FastAPI endpoint with the AuthJWT dependency injected. They cannot be imported and called standalone.","severity":"gotcha","affected_versions":">=0.2.0"},{"fix":"Define a Pydantic BaseModel with your settings and decorate it with `@AuthJWT.load_config`.","message":"Environment variable support was deprecated in v0.3.0. Loading settings via environment variables directly is no longer supported; use a Pydantic model with `@AuthJWT.load_config`.","severity":"gotcha","affected_versions":">=0.3.0,<0.4.0 (deprecated) or >=0.4.0 (removed)"}],"env_vars":null,"search_vec":"'0.5.0':14 'access/refresh':21 'auth':3,9 'authent':34 'author':27,35 'cadenc':16 'claim':31 'configur':29 'current':11 'denylist/revocation':25 'extens':5 'fastapi':1,4,32 'fresh':24 'irregular':18 'jwt':2,8,30,33 'provid':7 'releas':15 'support':10,20 'token':22,23 'version':12 'websocket':26","created_at":"2026-05-01T08:09:14.025431+00:00","updated_at":"2026-05-01T08:09:14.025431+00:00","problems":{"verify_error":"/tmp/tmpydxcsrk4/venv/lib/python3.12/site-packages/pydantic/_internal/_config.py:386: UserWarning: Valid config keys have changed in V2:\n* 'anystr_strip_whitespace' has been renamed to 'str_strip_whitespace'\n* 'min_anystr_length' has been renamed to 'str_min_length'\n  warnings.warn(message, UserWarn"},"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"0.5.0","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/IndominusByte/fastapi-jwt-auth","docs":"https://indominusbyte.github.io/fastapi-jwt-auth/","changelog":null,"pypi":"https://pypi.org/project/fastapi-jwt-auth/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["web-framework","auth-security","serialization"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"install_fail","verified_at":"2026-06-29","last_verified":"2026-06-29","next_check":"2026-07-09","install_tag":null}}