--- id: sanic-jwt version: "1.8.0" license: MIT license_treatment: permissive maintenance: dormant --- # sanic-jwt — JWT oauth flow for Sanic License: permissive · Maintenance: dormant · Downloads: 259.2K/mo ## What it is and what it does Sanic JWT is an authentication library for the Sanic web framework that wraps JWT tokens to protect endpoints and enforce authentication scopes. It depends on pyjwt for token handling and is designed to be both quick to set up—requiring only initialization with an authenticate callback—and extensible for custom authorization logic. The package provides a standard OAuth flow pattern: developers define an authenticate function, initialize the library with a Sanic app instance, and gain automatic protection on endpoints plus a built-in /auth endpoint for token issuance. It has been stable since its early releases but has not received updates since 2022-06-28, making it suitable for mature Sanic applications that do not require frequent framework upgrades. Use it for: - Protect Sanic API endpoints with JWT tokens and enforce role-based or scope-based access control. - Add OAuth-style authentication to existing Sanic applications without writing custom token middleware. - Customize authentication logic by defining your own authenticate callback to integrate with external identity providers. - Manage session-like authentication in microservices using JWT tokens instead of server-side sessions. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Sanic JWT adds JWT-based authentication and authorization to Sanic web applications, protecting endpoints and managing authentication scopes through a configurable OAuth flow. Yes, with conditions. The package is stable, has low install friction, carries a permissive MIT license, and has no known vulnerabilities. However, it is dormant—last updated in June 2022—so it is best suited for mature Sanic applications that do not require frequent framework upgrades. If you are using a recent Sanic version or expect active maintenance and updates, verify compatibility first or consider alternatives. ## Install pip install sanic-jwt uv add sanic-jwt poetry add sanic-jwt ## Installing sanic-jwt Before you install: Low install friction with a single runtime dependency (pyjwt). Maintenance is dormant—last release was 2022-06-28, though the repository remains active with a recent commit on 2024-10-13 and 246 stars. The package is marked Production/Stable but has not received updates in years. License in practice: MIT license (permissive) places no restrictions on use, modification, or distribution in proprietary or open-source projects. Quickstart: pip install sanic-jwt from sanic import Sanic from sanic_jwt import Initialize def my_authenticate(request, *args, **kwargs): # Your authentication logic pass app = Sanic() Initialize(app, authenticate=my_authenticate) Verify before relying: - Whether the package works with Sanic versions released after 2022 or Python versions beyond 3.9. - Current state of community support or whether security patches would be applied if vulnerabilities were discovered. - Compatibility with async/await patterns in recent Sanic releases. ## Package facts - License: MIT (permissive) - Python support: unspecified - Install friction: low - Maintenance: dormant - Downloads: 259.2K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags sanic authentication jwt, sanic oauth jwt, jwt protection sanic, sanic endpoint authorization, sanic jwt middleware, sanic oauth flow, jwt sanic framework, jwt-auth, sanic-framework [View on SkillFed](https://skillfed.io/packages/sanic-jwt) · [View on PyPI](https://pypi.org/project/sanic-jwt/)