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
1
vote
1 answer

Propagate JWT Token between services

I'm looking to propagate a JWT token between my services running in docker using the library flask-jwt-extended and I have an idea of how I would do this using something similar to this: request.post(url, json={"access_token": access_token,…
Annihil8
  • 322
  • 1
  • 2
  • 16
1
vote
1 answer

flask-jwt-extended current_user identity = None when creating non-fresh access token from refresh token

In my flask app (python 2.7), I am trying to trigger the access token to refresh via the refresh token whenever it expires with the @jwt.expired_token_loader decorator. Both the access token and refresh token are stored in a cookie…
Danny Diaz
  • 315
  • 3
  • 10
1
vote
1 answer

store jwt token into cookie in python flask restplust for login api

I have written REST API for login and logout using flask-restplus and flask_jwt_extended, I implemented jwt access_token generation that works seamlessly, but now I need to store token into cookie. my code is like this: api/user/resource.py from…
Chang Zhao
  • 512
  • 5
  • 14
1
vote
1 answer

jwt python can´t add token to user

i´m doing a simple project where I want to add jwt authentication. When I log in I try to create a new token but when i´m trying to see who´s the user using the token it says that the token is missing. I´m using Flask and SQLAlchemy with…
Ricardo Pinto
  • 131
  • 1
  • 1
  • 9
1
vote
3 answers

How do you check whether user is logged using flask-jwt-extended before logging him in.?

I am developing an API using flask-restful. I want to make sure that when a user is logged in, he cannot log in again unless he is first logged out. I am using flask-jwt-extended and am wondering whether there is a way to check where user is already…
Meshack Mbuvi
  • 341
  • 1
  • 14
1
vote
0 answers

api.header decorator of flask-restplus does not work for swagger documentation

I have a simple API GET method that returns list of IP's in terminal the implementation works fine and and I can use JWT token to get list of IP. However when I try the same using TRY-OUT button on Swagger documentation page it hangs for…
Ciasto piekarz
  • 6,378
  • 11
  • 59
  • 149
1
vote
1 answer

flask jwt extended how to pass audience

I am trying to pass audience as a parameter in flask jwt extended for decoding jwt token, My code is like this, @app.route('/api') @jwt_required def my_api(): return json.dumps('Welcome ') when i call my api i am getting { "msg": "Invalid…
backtrack
  • 7,500
  • 5
  • 43
  • 91
1
vote
1 answer

Flask-jwt-extended doesn't support required claims?

I'm using flask-jwt-extended over flask-jwt but there doesn't seem to be support for requiring claims. Is this something I have to implement myself in a new identity function and if so how do I override the existing functionality in…
James MV
  • 8,145
  • 14
  • 61
  • 87
0
votes
0 answers

Flask Decorating Pluggable Views

I have to decorate a MethodView. What will be a better way to do so? As per documentation, we have to use second method: 1) from flask_jwt_extended import ( jwt_refresh_token_required, get_jwt_identity ) from flask.views import…
Arun K S
  • 156
  • 2
  • 7
0
votes
1 answer

Flask JWT : get_jwt_identity() without @jwt_required always return Non

I am building a Flask JWT extended application, and here is what I want to do : I have and endpoint open to everyone (i.e. no decorator @jwt_required, everyone can access the link) but if someone access this link with an authentication, I want to be…
kilag
  • 193
  • 1
  • 11
0
votes
0 answers

API requests control and webapp login using Flask JWT Extended

I'm working on an API (Flask/Python) that will receive requests from and app (React-Native) and a Webapp (Flask/Python). For some API requests it will be necessary to have user access control. For that I'm using authentication by JWTs…
0
votes
1 answer

How to redirect if jwt is not presented in the request using Flask-jwt-extended

Is there a built-in way to redirect to login page if user comes without JWT or wrong JWT is used? @api.route('/private', methods=['GET']) @jwt_required() def protected(): logged = get_jwt_identity() return jsonify(logged_in=logged), 200
Alexey Nikonov
  • 2,164
  • 1
  • 19
  • 33
0
votes
1 answer

throwing error for flask jwt extended refresh token

I am trying to implement refresh token system in flask_jwt_extended, I followed official documentation. When I try to get new access_token with refresh_token using postman I get the response with new access token. But when I try with axios call it…
venkat g
  • 35
  • 5
0
votes
0 answers

Create a HTTP header with Javascript for Flask Application (JWT-Extended)

I'm creating a Flask web application, and for the authentication and forms I use the JWT-Extended package, specifically using cookies. When I decorate a route (POST method) with @jwt_required() and from my HTML form I send the values to the route,…
0
votes
0 answers

receiving error for flask_jwt_extended refresh token

I am trying to implement refresh token system in flask_jwt_extended, I followed official documentation. When I try to get new access_token with refresh_token using postman I get the response with new access token. But when I try with axios call it…
venkat g
  • 35
  • 5