How to validate an Access Token using python-social-auth?

38 Views Asked by At

I'm trying to do websocket authentication. I can pass the token via query_string. How to verify a token and decode it?

Custom Authentication:

class WebSocketJWTAuthMiddleware:

    def __init__(self, app):
        self.app = app

    async def __call__(self, scope, receive, send):
        parsed_query_string = parse_qs(scope["query_string"])
        token = parsed_query_string.get(b"token")[0]
        print(token)

        try:
            # Token validation
        except:
            pass

        return await self.app(scope, receive, send)
0

There are 0 best solutions below