python-jose

JWT encrypting payload in python? (JWE)

微笑、不失礼 提交于 2019-12-10 13:02:24
问题 According to RFC 7516 it should be possible to encrypt the payload/claim, called JWE. Are there any python libraries out there that support that? I've checked PyJWT, python-jose and jwcrypto but they all just have examples for signing with HS256 (JWS). Sorry if this is totally obvious, but when it comes to things involving crypto I'm extra cautious. 回答1: Both Jose and jwcrypto libraries can do JWE. For jose: claims = { 'iss': 'http://www.example.com', 'sub': 42, } pubKey = {'k':\ '-----BEGIN

How to decode Firebase JWT token in Python

限于喜欢 提交于 2019-12-04 21:22:10
问题 I have added Firebase to allow clients to authenticate directly from the web app client (browser). I am using the firebase-web JS package and it works great. I can see in my browser that I receive a user object with information about the user, including an idToken . I need to then authenticate this user on my server backend, which is python django. In the Firebase docs I found a how-to for exactly what I am trying to do, which is to verify the id token. Since they don't have the supported