Questions tagged [flask-httpauth]

Simple extension that provides Basic and Digest HTTP authentication for Flask routes.

Flask is a microframework for Python based on Werkzeug, Jinja 2 and good intentions. Flask-httpauth is built on this framework and is available at https://github.com/miguelgrinberg/flask-httpauth.

42 questions
0
votes
1 answer

sharing flask_httpauth 's HTTPBasicAuth across multiple Flask RestPlus endpoint files

I have a project that has the following structure app.py | endpoints(directory) __init__.py endpoints_1.py endpoints_2.py auth_endppints.py auth_functionality_module.py etc ... app.py has the following…
0
votes
1 answer

Using Flask-HTTPAuth when serving a static folder

I'm using Flask to serve a static folder: from flask import Flask, send_from_directory from flask_httpauth import HTTPBasicAuth app = Flask(__name__, static_url_path='', …
Netanel
  • 459
  • 1
  • 5
  • 17
0
votes
0 answers

Securing Flask-Admin with Flask-HTTPAUTH

So I have looked everywhere for this but I couldn't find an answer. I have recently integrated flask-admin to my flask application, which is already, partly secured using flask-httpauth's basic authentication. I am using the @auth.verify_password…
0
votes
1 answer

AttibuteError: '_AppCtxGlobals' object has no attribute 'user'

To set some context I'm creating an API through Flask. To authenticate users, I'm using flask-HTTPAuth. As a part of accessing login protected resources, I've defined my verify_password callback in auth.py. If the user credentials provided evaluate…
binny
  • 649
  • 1
  • 8
  • 22
0
votes
1 answer

How do I send username and password in request from frontend for auth with flask_httpauth?

I have an app that implements basic username and password authentication. I wanna be able to send username and password auth headers along with my form data when i make a request from frontend. how can I send those username and password headers…
rootkit
  • 353
  • 1
  • 3
  • 15
0
votes
2 answers

How do I replace a decorator at runtime?

I'm trying to adapt another StackOverflow answer on conditionally applying a decorator to only require login for a specific environment (eventually a staging environment, but development until I get this working). Toward that end, I started with the…
Chuck
  • 4,662
  • 2
  • 33
  • 55
0
votes
0 answers

using flask auth.verify_password with session

I'm struggling a bit to get the auth working properly. I'm controlling the login behavior through api's instead of the web application. For this, i'm using flask session and HTTPBasicAuth(). After a user logs in and until he logs out, I don't want…
user3327034
  • 395
  • 3
  • 13
0
votes
1 answer

AttributeError: 'function' object has no attribute 'verify_password'

I am trying to incorporate basic authentication as shown in this link https://github.com/miguelgrinberg/Flask-HTTPAuth/blob/master/examples/basic_auth.py in my flask app. The app is deployed on Heroku. The error I keep getting is…
Rishit Shah
  • 355
  • 5
  • 20
0
votes
1 answer

Flask-restful app fails when authentication is enabled

I'm getting this error whenever I try and enable authentication using flask_httpauth for my flask_restful project: AttributeError: 'function' object has no attribute 'as_view' Here's a very basic example: apicontroller.py: from flask_restful import…
Trondh
  • 3,221
  • 1
  • 25
  • 34
0
votes
1 answer

Making Flask API more secure

I'm using Flask-HTTPAuth (https://github.com/miguelgrinberg/Flask-HTTPAuth) to protect my API with a username and a password. Since this is running on port 8080, I've opened the port on my VM and made it public. Is there anything else I can do to…
90abyss
  • 7,037
  • 19
  • 63
  • 94
0
votes
1 answer

How can I create a custom login validation method for flask-httpauth?

Today I am creating a small RESTfull service with python and flask. I cannot seem to work out the auth, it seems. Here is my code : # Extensions auth = HTTPBasicAuth() def login_user(username,password): # If the username can be decoded as a JWT…
dv4RqQUh
  • 15
  • 5
0
votes
0 answers

Localhost issue with flask-http auth

I have the following: @auth.verify_password def verify_password(username_or_token, password): logger = logging.getLogger('__name__') logger.error('username = %s' %username_or_token) # first try to authenticate by token user =…
user2268507
1 2
3