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.
Questions tagged [flask-jwt-extended]
143 questions
0
votes
0 answers
flask_jwt_extended response need to capture before sent to the client
need to catch the response messages of
@jwt_required()
inside the application
ex: if token not available or expire, I need to send a custom response to the client
this is my sample code..
app = Flask(__name__)
app.config["JWT_SECRET_KEY"] =…
0
votes
3 answers
Flask POST requests fail when JWT_COOKIE_CSRF_PROTECT=True
My POST requests to flask backend only work with JWT_COOKIE_CSRF_PROTECT = False, but GET requests work
config:
CSRF_ENABLED = True
CORS_SUPPORTS_CREDENTIALS = True
JWT_TOKEN_LOCATION = ['cookies']
I access flask through axios from the Vue…

adam
- 655
- 1
- 10
- 31
0
votes
0 answers
flask_jwt_extended.exceptions.NoAuthorizationError: Missing Authorization Header - Authorization not working
I am using flask_jwt_extended for jwt authentication in my flask web application. After the user enters email and password, I make a token using create_access_token and then redirect to another link which can only be accessed with…

za_ali33
- 366
- 2
- 9
0
votes
1 answer
Does flask cors and jwt extended work together
I am having the following error from the below function. If I remove jwt_required, it does work, so I am guessing CORS is allowing access. What could be the issue?
@app.route('/user_authentication/protected',…

adam
- 655
- 1
- 10
- 31
0
votes
1 answer
Working with flask-jwt-extended and flask-restx for Headers and Cookie Token
I'm building an API with Flask-Restx, and I'm using flask-jwt-extended for the JSON web Token, I have views like this
class InputReaderView(Resource):
"""Endpoint for validate args from PMR Response with XSD and Validate DataType from…

perymerdeka
- 766
- 9
- 19
0
votes
1 answer
how do i prevent Resources can be accessed by old jwt?
In my flask app, resources are handled with @jwt_required(). A new login creates a new JWT Token. I saved access_token in database and removed old jwt. But i can access the resources with the old jwt token. Is there any process where i can prevent…

Nahidul Islam
- 17
- 1
- 4
0
votes
1 answer
Using Flask-JWT-Extended with Flask-restx
I'm building an API using Flask-restx, I'm using a token system for authentication, I'm using Flask-JWT-Extended, in my case I managed to get the token, but I'm having trouble putting it in views, I'm using a decorator
@jwt_required decorator on…

perymerdeka
- 766
- 9
- 19
0
votes
1 answer
create a function that generate a JWT token and send to server the server will verify that token and give response if token is valid
I made an API for my personal use in the Flask without any database, I want to add token authentication to that API without any user Sign Up. I want, can generate a JWT and send that to the server then Server can verify that JWT is valid then send a…

Ajay Kumar Joshi
- 11
- 3
0
votes
1 answer
How to secure an endpoint for selected users with Flask-JWT-Extended?
Say I want to protect a route called /protected, I will do the following:
@app.route('/protected')
@jwt_required
def protected():
return "Protected", 200
Doing so will mean that only authenticated users can access /protected. But what if I want…
user18719885
0
votes
0 answers
Flask / jwt_extended import custom override default behaviors, How to import?
Using: Flask, jwt_extended
Background
As my code/test project has grown, I've split it into several routes, and have run into a problem with custom overrides for jwt_extended.
These routes are loaded from:
**File: .../__init__.py** (project…

utc_extended
- 1
- 1
0
votes
2 answers
Why doesn't Flask see JWT cookie while sending POST request
I am trying to submit simple HTML form to my Flask app on this POST route but I am getting unauthorized error, because Flask/JWT (I am not sure) doesn't find it in cookies. It works fine with the GET request on the same route (it finds the…

jestrabikr
- 420
- 5
- 12
0
votes
1 answer
flask_jwt_extended giving "jwt.exceptions.InvalidSignatureError: Signature verification failed" error
I am using AWS Coginto to sign in a user and retrieve the authorization and refresh token response. I am able to successfully authenticate, retrieve the tokens, and decode the tokens. I verify the tokens are decoded on https://jwt.io/.
However, when…

Alex F
- 2,086
- 4
- 29
- 67
0
votes
2 answers
Python not recognizing flask-jwt-extended module?
I have a very annoying problem that I've been trying to fix all day. I'm working on a Flask API in Python 3.9.6; running in a venv. I have pip installed and imported flask-jwt-extended for authentication purposes, but neither VSCode nor Pycharm can…

Renta
- 65
- 1
- 7
0
votes
2 answers
How can I get current user's JWT informations?
I'm trying the get all orders that belonging the user that already login to the system.
I want to get the id information of the current user with the get() method below and get the order information belonging to current user from the order table.
My…

baris
- 48
- 7
0
votes
2 answers
APIs: Do you need to send the authentication header token with every request?
I'm currently making an API and wanted to know if the API user has to send the token every time they make a request. I'm using Flask_JWT_Extended to handle authentication with the API. The token gets send in the header.

pop smoke
- 33
- 4