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.

143 questions
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
  • 7,853
  • 18
  • 101
  • 197
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,996
  • 5
  • 52
  • 99
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,569
  • 17
  • 65
  • 96
0
votes
1 answer

Flask does not process exception using Flask-JWT-Extended custom handler

What I have I have a flask app that uses a Flask-JWT-Extended extension for processing user authentication and Flask-RESTx for API definition. Here is a route for getting current user: @user_api.route("/", endpoint="get_user") class…
0
votes
0 answers

How to proceed with the JWT token on client side, after middleware

i want to Authenticate my routes with JWT and i have some questions. I have a flask backend server and i am using the jwt extended flask library. When i log in to my app i produce a JWT token with this way app.config["JWT_COOKIE_SECURE"] = False…
0
votes
1 answer

Why does enabling @jwt_required on all my routes cause an assertion error in Flask's __init__.py?

When I enable @jwt_required on all my routes in users.py, running __init__.py fails and shows assertion error. If I enable @jwt_required only on 1 of the routes (doesn't matter which one), the flask app succeeds in building. This is for a…
0
votes
0 answers

How do I refresh JWT token (cookies) when user visits site with expired token

I'm currently facing some confusion regarding token refreshing in my website. I've implemented JWT (JSON Web Tokens) with an extended expiration time, and I store these tokens in cookies. My objective is to automatically refresh the token whenever a…
GoekhanDev
  • 326
  • 2
  • 4
  • 20
0
votes
1 answer

AADSTS500011 , inserting scope in azure authentication returns error

I am currently trying to verify an access token generated using msal python. I created my ConfidentialClientApplication like this app = ConfidentialClientApplication( "", #client id …
GnomeMage
  • 45
  • 1
  • 2
  • 5
0
votes
0 answers

Flask login for REST API and Web application both

I want to do a Flask application with both REST API and Web Application. For example, my application will have protected routes: /notes - for viewing all notes of user /notes/ - for viewing ceratin note And same protected routes but in…
purity
  • 108
  • 5
0
votes
0 answers

flask_jwt_extended docs shows javascript not python for accessing cookies

Setting cookies is shown from flask but accessing the cookies is shown using javascript. Is this because it's assumed the frontend will be written in javascript not python? What if I want to use 'render_template' of flask to serve some html and…
am1234
  • 93
  • 1
  • 9
0
votes
0 answers

Error when gogin using cookie, firebase authentication and flask-jwt-extended

I was able to work with Firebase JWT and Flask JWT Extended in order to login my users and validate the JWT. To validate the JWT issued by Firebase to my app I had to code the following: import requests from cryptography import x509 from app import…
0
votes
0 answers

Flask-JWT-Extended: Why am I getting a function object instead of a decoded token using decode_token()?

I'm trying to decode a JWT token using Flask-JWT-Extended's decode_token() function, but it's returning a function object instead of the decoded token. Here's my code: @app.route("/resend-verification-email", methods=("GET", "POST")) def…
0
votes
0 answers

Flak wrappers for authentication

I am trying to put a validate wrapper around my flask endpoints to check if the user has permissions to the data. I want to define the permissions required in the decorator and then the wrapper verifies the user has those roles. def…
0
votes
0 answers

document.cookie returns empty string, even although there's one cookie with no HttpOnly attribute

In a Typescript-React SPA, I'm trying to access the document.cookie in order to retrieve a token sent together with a JWT cookie, intended to protect my Flask API against CSRF attacks, as described here. The basic idea is that my API will send 2…
LeperAffinity666
  • 364
  • 4
  • 14
0
votes
0 answers

Using JWT_EXTENDED python with flask and having issues when other cookies join the party

So when I only have the JWT_EXTENDED cookie set my axios/flask/gunicorn app works swimmingly.... so xis.test.com is great.... << domain of the cookie the problem starts when other cookies get set under ".test.com" then ajax calls with a larger…
BostonMacOSX
  • 1,369
  • 2
  • 17
  • 38