Open andreixk opened 4 years ago
I'm using flask-jwt-extended for JWT handling and enabled CSRF protection.
app.py
from flask_restx import Api, Resource from flask import Flask, Blueprint from flask_jwt_extended import JWTManager from flask_cors import CORS app = Flask(__name__) CORS(app, resources={r"/*": {"origins": "*", "supports_credentials": True}}) app.config['JWT_TOKEN_LOCATION'] = ['cookies'] app.config['JWT_COOKIE_CSRF_PROTECT'] = True app.config['JWT_COOKIE_SAMESITE'] = 'Strict' app.config['JWT_ACCESS_TOKEN_EXPIRES'] = 36000 jwt = JWTManager(app) blueprint = Blueprint('api', __name__, url_prefix='/api/v1') main_api = Api( blueprint, title="Main API", version='1.0', description='API documentation', doc='/swagger', ) # User actions main_api.add_namespace(user.ns) app.register_blueprint(blueprint)
Proper function
401 Error: UNAUTHORIZED Response body: { "msg": "Missing CSRF token" }
There is a very similar open ticket in flask-restplus. There was even a PR, that was never merged.
+1 Any updates?
Any updates?
Hi, any updates?
I'm using flask-jwt-extended for JWT handling and enabled CSRF protection.
Code
app.py
Repro Steps (if applicable)
Expected Behavior
Proper function
Actual Behavior
Environment
Additional Context
There is a very similar open ticket in flask-restplus. There was even a PR, that was never merged.