A JOSE implementation in Python based on PyJWT.
Questions tagged [python-jose]
21 questions
13
votes
3 answers
JWT encrypting payload in python? (JWE)
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…

Johnny
- 133
- 1
- 2
- 13
10
votes
1 answer
How to decode Firebase JWT token in Python
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,…

jeffery_the_wind
- 17,048
- 34
- 98
- 160
5
votes
1 answer
How to generate a RS256 signed token I decode with jose.jwt.decode
I have a function that takes in a token, decodes it, and uses the payload to perform some logic. I would like to generate tokens with claims I manipulate to test that function.
I generated a keypair from https://mkjwk.org/ and use it in the…

delisdeli
- 839
- 9
- 20
4
votes
2 answers
CryptographyDeprecationWarning: int_from_bytes is deprecated, use int.from_bytes instead
INFO:Uvicorn running on http://0.0.0.0:8000 (Press CTRL+C to quit)
INFO:Started reloader process [27528] using statreload
C:Python\Python39\lib\site-packages\jose\backends\cryptography_backend.py:18:
CryptographyDeprecationWarning: int_from_bytes…

Ajmal Ali
- 91
- 1
- 6
4
votes
0 answers
Python jose.jwt.decode fails on rs256 algorithm
https://github.com/Ofineo/coffee-shop
I try to decode a JWT with jose.JWT.decode in Auth.py but I always get an error:
jose.exceptions.JWKError: Could not deserialize key data.
After a lot of investigations, I pinned it down to the RS256 algorithm.…

J.melendez
- 43
- 1
- 7
4
votes
1 answer
Which Python JOSE library supports nested JWT (signed+encrypted)?
I looked at python-jose and jose but neither seem to support encrypting a signed JWT. For example, "jose" library supports signing and encrypting separately, without nesting them.
Am I missing something, like perhaps it's fairly easy to nest JWTs…

Slawomir
- 3,194
- 1
- 30
- 36
3
votes
2 answers
Python decode jwt token USING JOSE module
Please help me to decode this jwt USING python jose module.
I don't know what key I should use. because any online jwt decoder can decode it without any key.
token =…

salius
- 918
- 1
- 14
- 30
2
votes
1 answer
error with python and python-jose in lambda function
I am somewhat new to python and have never used it before to verify jwt tokens.
I'm writing a lambda function. I'm sure the issue is something simple but can't seem to get around it.
I keep getting this error:
{
"errorType": "JWTError",
…

Mike
- 763
- 2
- 12
- 25
2
votes
0 answers
Why is C++ 14.0 required to install python-jose
I'm getting this error when I issue pip install python-jose on Windows:
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools
I'm confused as why I…

user3253156
- 381
- 1
- 2
- 10
1
vote
0 answers
How could I implement a refresh token that works with the implementation of the access token shown in the FastAPI docs using `python-jose`?
I am trying to implement a rotating refresh token with an access token (JWT) in FastAPI. However, for now I just want to get a standard refresh token implementation working with no rotation occurring.
The FastAPI docs have an example of the…

Harry Myburgh
- 33
- 3
1
vote
1 answer
" ModuleNotFoundError: No module named 'jose' " ; but it's already installed
Process SpawnProcess-9:
Traceback (most recent call last):
File "C:\Users\gveda\AppData\Local\Programs\Python\Python310\lib\multiprocessing\process.py", line 314, in _bootstrap
self.run()
File…

Vedant Gawande
- 11
- 2
1
vote
2 answers
Unable to verify Firebase token
I am making an app in flutter which uses Google sign-in. I also have a Django backend linked to the app and I want to verify the user in the Django backend. I found many solutions on the internet but none is working. Probably I am messing up…

Ashish Kumar
- 83
- 9
1
vote
0 answers
Python-Jose with Google App Engine
I am trying to get python-jose to work with Google App Engine.
As soon as I add from jose import jwt I get an error ImportError: No module named Crypto.Random.OSRNG.winrandom
In the README.rst it says:
This is a JOSE implementation that is fully…

Karl Stulik
- 961
- 1
- 12
- 24
0
votes
0 answers
JWT token from Azure AD is not getting decoded for some, for some its getting decoded using (python-jose)
We are facing a strange problem here, token from Azure AD is being decoded for some, while for some people it is not getting decoded because of which APIs are failing, a flask framework based app uses Azure AD authentication. Adding the code snippet…
0
votes
1 answer
What am I doing wrong in the following code where I'm trying to achieve asymmetric signing and encryption using jose-python?
from jose import jws
from jose import jwe
with open('privkey.pem', mode='r') as privatefile:
privkey = privatefile.read()
with open('pubkey.pem', mode='r') as pubfile:
pubkey = pubfile.read()
…

Taz
- 15
- 3