Hi all,
I hope someone can answer this question. When using the @requires_auth
on a route I’ve created in a Python and Flask API, I’m receiving this error message:
* Traceback (most recent call last):*
* File "/usr/local/lib/python3.6/dist-packages/flask/app.py", line 2309, in __call__*
* return self.wsgi_app(environ, start_response)*
* File "/usr/local/lib/python3.6/dist-packages/flask/app.py", line 2295, in wsgi_app*
* response = self.handle_exception(e)*
* File "/usr/local/lib/python3.6/dist-packages/flask_restful/__init__.py", line 269, in error_router*
* return original_handler(e)*
* File "/usr/local/lib/python3.6/dist-packages/flask/app.py", line 1741, in handle_exception*
* reraise(exc_type, exc_value, tb)*
* File "/usr/local/lib/python3.6/dist-packages/flask/_compat.py", line 35, in reraise*
* raise value*
* File "/usr/local/lib/python3.6/dist-packages/flask/app.py", line 2292, in wsgi_app*
* response = self.full_dispatch_request()*
* File "/usr/local/lib/python3.6/dist-packages/flask/app.py", line 1815, in full_dispatch_request*
* rv = self.handle_user_exception(e)*
* File "/usr/local/lib/python3.6/dist-packages/flask_restful/__init__.py", line 269, in error_router*
* return original_handler(e)*
* File "/usr/local/lib/python3.6/dist-packages/flask/app.py", line 1718, in handle_user_exception*
* reraise(exc_type, exc_value, tb)*
* File "/usr/local/lib/python3.6/dist-packages/flask/_compat.py", line 35, in reraise*
* raise value*
* File "/usr/local/lib/python3.6/dist-packages/flask/app.py", line 1813, in full_dispatch_request*
* rv = self.dispatch_request()*
* File "/usr/local/lib/python3.6/dist-packages/flask/app.py", line 1799, in dispatch_request*
* return self.view_functions[rule.endpoint](**req.view_args)*
* File "/usr/local/lib/python3.6/dist-packages/flask_cors/decorator.py", line 128, in wrapped_function*
* resp = make_response(f(*args, **kwargs))*
* File "/home/raindropadmin/scripts/auth0.py", line 145, in decorated*
* token = get_token_auth_header()*
* File "/home/raindropadmin/scripts/auth0.py", line 119, in get_token_auth_header*
* "Authorization header is expected"}, 401)*
* auth0.AuthError: ({'code': 'authorization_header_missing', 'description': 'Authorization header is expected'}, 401)*
Can someone assist?
Thank you in advance!