Questions tagged [pyjwt]

Anything related to PyJWT library. It is JSON Web Token implementation in Python.

PyJWT is a Python library for encoding and decododing JSON Web Tokens (JWT). JWT is a compact, URL-safe means of representing claims to be transferred between two parties. It is intended for space constrained environments such as HTTP Authorization headers and URI query parameters. It is defined in industry-standard RFC 7519.

Learn more about it on PyJWT site

106 questions
0
votes
1 answer

No matching distribution found for PyJWT<3.0.0,>=2.0.1

I' trying to install ibm_watson library following the steps from their web: https://cloud.ibm.com/apidocs/assistant/assistant-v1?code=python However I get this error: Could not find a version that satisfies the requirement PyJWT<3.0.0,>=2.0.1 (from…
Rorepio
  • 332
  • 1
  • 4
  • 16
0
votes
0 answers

Python, load RSA-256 public key into code

I'm trying to load a public key in RSA-256 in Python. public_key=Out[24]: '-----BEGIN…
yovel cohen
  • 267
  • 3
  • 12
0
votes
2 answers

How to encode private key as JSON WEB TOKEN in RS256 format using python

Well I have gone through a lot of questions, and their respective answers, mostly instead of private key (which starts from -----BEGIN RSA PRIVATE KEY-----) to encode in jwt, public key was being sent (which does not begin from -----BEGIN RSA…
Huwaiza
  • 77
  • 2
  • 13
0
votes
1 answer

extract cryptographic key from json keypair

This one's very straightforward but I'm struggling to find the answer elsewhere. Given an RS256 keypair, which of the variables is the private key? I've generated a RS256 JWK at mkjwk.org and it looks like this: { "p": "some string value", "kty":…
Neil
  • 3,020
  • 4
  • 25
  • 48
0
votes
1 answer

Cannot decode token in python created in ASP.NET using secret

Secret is created in .Net using below code var key = new byte[32]; RNGCryptoServiceProvider.Create().GetBytes(key); var base64Secret = TextEncodings.Base64Url.Encode(key) Audience newAudience = new Audience { ClientId = clientId, Base64Secret =…
vivek
  • 61
  • 1
  • 1
  • 8
0
votes
1 answer

Microsoft AD JWT Won't Decode

I've used the python code sample below from Microsoft to try and decode access and identity tokens (JWT) from Microsoft AD. I've tried every method I can find online for doing this and no matter what I keep getting this error: File…
Connor
  • 35
  • 2
  • 8
0
votes
1 answer

pyjwt raises TypeError

I'm using pyjwt as follows: def encode_auth_token(self, user_id): '''Generates the auth token.''' try: payload = { 'exp': datetime.utcnow() + datetime.timedelta( days =…
Mark
  • 161
  • 11
0
votes
1 answer

Flask Restful with PyJWT Authentication

Background: I'm trying to prototype a quick token-based authentication using Flask-Restful and PyJWT. The idea is that I will have a form with email and password and when user clicks submit, it will generate a token and save it in client side…
Jessi
  • 1,378
  • 6
  • 17
  • 37
0
votes
1 answer

How to migrate from using Flask-JWT to PyJWT in my app?

I want to switch from using Flask-JWT since it is no longer being updated. My problem is that I'm not sure how to achieve some of the functionality that Flask-JWT was giving me. For example: jwt = JWT(app, verify, identify) With Flask-JWT i could…
feners
  • 645
  • 5
  • 19
  • 48
0
votes
1 answer

generating token for flask-jwt giving incorrect method error

I used flask-jwt in my project and I have declared in controller.py: def _validate_user(email, password): """ validates user from db """ user = Users.get_user(email) if check_password_hash(user.password_hash, password): …
Ciasto piekarz
  • 7,853
  • 18
  • 101
  • 197
0
votes
1 answer

Is any needs to create a simple login view when using djangorestframework-jwt obtain_jwt_token views?

Basically I want to developed a system where user logged in using username and password using 'JSONWebTokenAuthentication'.That's way I am use 'django rest framework JWT'.Before i was create an accounts app where user can registration and login…
0
votes
1 answer

Vulnerabilities found in PyJWT back in 2015

Just wanted to confirm something related to Flask-JWT using PyJWT library. Back in 2015 (https://auth0.com/blog/critical-vulnerabilities-in-json-web-token-libraries/) vulnerability issue was found with PyJWT. I'm not sure if that has been fixed now…
GeekOnGadgets
  • 941
  • 3
  • 14
  • 47
0
votes
1 answer

how to change expired time in REST framework JWT Auth

I read official document of REST framework JWT Auth. It provides the additional setting options for setting expired time. However, I am not sure where to insert the setting options code. Do I need create a separate setting file to hold it or just…
pipi
  • 705
  • 1
  • 8
  • 16
0
votes
1 answer

pyjwt raises an error on decode

I am using PyJWT to generate and validate JWT in Python. Running pypy3 v2.4. Simply trying to encode and decode a JWT similar to the example in the GitHub repo. I am getting the following error when decoding: decoded = jwt.decode(encoded,…
Sincere
  • 477
  • 5
  • 18
-1
votes
1 answer

key value to be sent in pyjwt library

I saw the usage of JWT here But I am not sure where do we get the value for "key" parameter to be passed to token = jwt.encode(payload, key) Sorry I am new to this, my requirement is to pass JWT token to my corporate URL from selenium python. Just…
Ram
  • 155
  • 1
  • 5