{"repo":"usamashehab/django-channels-jwt","free":true,"listed":false,"github":"https://github.com/usamashehab/django-channels-jwt","clone":"git clone https://github.com/usamashehab/django-channels-jwt.git","description":"Secure JWT Auth Middleware for Django Channels","language":"Python","stars":14,"topics":["authentication","channels","django","jwt","middleware","security"],"license":"MIT","category":"auth-billing-email","readme_excerpt":"Django Channels JWT Django Channels JWT Middleware is a secure way to handle authentication for Django Channels WebSocket connections without directly exposing JWT tokens. Instead of sending the token itself in the query parameter, this middleware uses UUID-based authentication and cache-based user retrieval for enhanced security. Compatibility Package Supported versions ---------- -------------------- Django 4.2, 5.0, 5.1, 5.2 channels 4.x Python 3.10, 3.11, 3.12, 3.13 Security Benefits - Enhanced Security : JWT tokens can potentially be intercepted if sent as query parameters. This middleware avoids sending tokens directly, minimizing the risk of token leakage. - UUID-based Authentication : This middleware generates UUIDs as tokens for WebSocket connections. These UUIDs are short-lived and act as temporary access keys. When a user connects, they provide the UUID, which is used to retrieve the authenticated user. - Cache-based User Retrieval : Upon connection, the middleware validates the UUID, retrieves the corresponding user ID from the cache, and fetches the user asynchronously. This ensures that the WebSocket connection is only established for authenticated users. Risks of Sending Tokens as Query Parameters Sending tokens as query parameters can expose security vulnerabilities: - Token Exposure : Tokens in query parameters can be captured in logs, browser history, or server logs, increasing the risk of unauthorized access. - Caching : Some proxies or servers may cache UR","default_branch":null,"files":null,"tree":[],"storefront":"/r/usamashehab","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/usamashehab/django-channels-jwt/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}