Questions tagged [flask-jwt-extended]

Flask-JWT-Extended is an opinionated Flask extension that adds support for using JSON Web Tokens (JWT) to protect views. It also many helpful (and optional) features built in to make working with JSON Web Tokens easier.

111 questions
0
votes
1 answer

verify_jwt_in_request() returns None when called in custom Flask Decorator

I am trying to create a custom decorator that makes use of verify_jwt_in_request() from the flask-jwt-extended library. My code is laid out as below: @app.route("/test-auth", methods=["POST"]) @custom_auth_required def test_auth(): …
lordlabakdas
  • 973
  • 4
  • 14
  • 29
0
votes
1 answer

flask_jwt_extended exceptions NoAuthorizationError

I am building the flask app using the flask restful. For generating the access token am using the flask_jwt_extended module. Am able to generate the access_token ,refresh_token, But while accessing the API it is throwing the below error, am passing…
0
votes
1 answer

Persist cookies on page reload of Vue SPA

I am creating a simple SPA with a Vue frontend and Python API using Flask. Currently, I have everything configured on my local machine (API running at localhost:5000 and Vue SPA accessible at localhost:8080). I am using flask-jwt-extended to manage…
walshbm15
  • 51
  • 5
0
votes
0 answers

Is there a way to intercept a 401 status code from flask_jwt_extended and return this value?

So I have a JWT token being generated and after 10 minutes it expires. Once it expires, I want to be able to catch this 401 error code. I am using flask_jwt_extended library. This is my code: @dossier_blueprint.route("/week",…
0
votes
1 answer

Storing JWT tokens externally in Flask-JWT-Extended

I have a Flask app running in AWS using Flask-JWT-Extended. It is serving REST API calls to a web app. As I understand from the documentation, the tokens are generated and stored in memory. I am considering storing them external to the Flask app…
Paul Waldo
  • 831
  • 7
  • 19
0
votes
1 answer

Route53 route subdomain to AWS Lambda getting 404

I have a domain in aws route53. My frontend is routed to that domain from cloudfront via alias and works perfectly. My backend sits on aws lambda and I want to put it behind my domain so my users can authorize using jwt cookies. I created…
0
votes
1 answer

Flask-JWT-Extended: @jwt_refresh_token_required annotation does not work

I have a login resource (/login endpoint), following Oleg Agapov's tutorial: class UserLogin(Resource): def post(self): data = parser.parse_args() current_user = User.find_by_email(data['email']) if not current_user: …
0
votes
1 answer

How to put auth functionality in @app.before_request in flask

I want to make auth layer in flask app . I was using flask-jwt-extended for jwt auth so for that i have to mentioned @jwt_requied decorator for each protected route . so i dont want to do that for each protected route. I thought to define a function…
VVK kumar
  • 127
  • 1
  • 11
0
votes
2 answers

Flask JWT Extended "The specified alg value is not allowed" Error

When making a request to a flask route that requires a JWT to access using (@jwt_required decorator on flask-restful resources), I get a 422 UNPROCESSABLE ENTITY with the message: The specified alg value is not allowed. When logging in and…
TomHill
  • 555
  • 1
  • 6
  • 23
0
votes
0 answers

Best practices for user authentication for combined web app and api

I'm working on a flask web application using flask-login for user authentication. Now the current layout is going through some changes and it was decided that some of the components should obtain data from the server in order to update on user…
0
votes
1 answer

Allow JWT Tokens if Expired, Provided User is from Trusted IP address

Using flask-jwt-extended, I have a situation where the API has to serve both users, and also a series of web-applications (for example, one of the latter is a chatbot). For the users, the package functionality out of the box is just perfect,…
Nicholas Hamilton
  • 8,709
  • 5
  • 47
  • 75
0
votes
2 answers

How to use a jwt from a different issuer?

I am building an flask API that will manipulate data to be used in thingsboard. Long story short, client logs in via thingsboard, get a jwt from that. But the API rejects the jwt saying that signature verification failed. Same secret key is being…
JonYork
  • 1,107
  • 7
  • 27
  • 44
0
votes
1 answer

flask-jwt-extended - Catch raise RevokedTokenError('Token has been revoked')

I already tried reading the documents as well try out the changing default behaviors https://flask-jwt-extended.readthedocs.io/en/latest/changing_default_behavior.html to handle the error (the link shows how to handle expired token) and search…
Mheruian
  • 123
  • 7
0
votes
1 answer

Use JWT-Extended to produce JSON Web Signatures for user confirmation

I am building a RESTful API for an upcoming project. This needs some kind of user account verification. I implemented a token based confirmation procedure previously using itsdangerous. But I wonder wether I can accomplish the same by using…
Leonleon1
  • 135
  • 2
  • 8
0
votes
1 answer

Get other user jti for flask-jwt-extended

How to get 'jti', not mine but by the "username" ? On registration/login jti for access and refresh were assigned to 'username'. All instructions and docs note only how to get my own jti to logout with smth. like this code: class…
Igor Tischenko
  • 520
  • 5
  • 16