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
1
vote
0 answers

Flask HTTP Token Auth how to fetch objects owned by signed in user

I am building a Flask API, and I have set up the login with flask_httpauth's HTTPBasicAuth and HTTPTokenAuth. That is to say, I first send in the username and password, after which the API would return a token to me, and I would send that token in…
Samson
  • 1,336
  • 2
  • 13
  • 28
1
vote
1 answer

Using Flask BasicHTTPAuth with Google Cloud Functions

I'm having difficulty with my Cloud Function in GCP that is simply supposed to return the raw XML stored in a GCS Bucket when invoked with a basic GET request. It works fine without any type of authentication, however since I added the…
1
vote
0 answers

Token based authorization results in an Unauthorized 401

Package versioning Flask 1.0.2 Flask-HTTPAuth 3.2.4 Flask-RESTful 0.3.8 itsdangerous 0.24 I'm working on a API project where a POST request to a Todo resource requires an user to have a token. Upon trying to test for this scenario, I'm…
binny
  • 649
  • 1
  • 8
  • 22
1
vote
0 answers

How to properly use flask @auth.login_required in multi-files project?

My Flask API REST server is becoming larger and larger so I decided to split methods (urls) into different sub files. My previous version (single file app) worked with verify_password() callback function to override standard method as in this…
Filippico
  • 21
  • 2
1
vote
1 answer

Flask UWSGI ModuleNotFound

I have a Flask application that I'm trying to configure for a production environment. So far, during testing python app.py inside of a virtualenv works fine. However, I'm beginning to configure the application to begin using UWSGI. When I attempt to…
1
vote
1 answer

Verify Basic Auth has the same Username as in URL [Flask]

Basically I am doing a hybrid of sending the username in the url and in Basic Auth when I need the user to be authenticated. My full code is: from flask import Flask, request, send_from_directory, g from flask_restful import Resource, Api from…
Jugbot
  • 142
  • 1
  • 14
1
vote
1 answer

Flask-HTTPAuth user access levels

I'm currently building a REST API using Flask-RESTful and using Flask-HTTPAuth to protect some of the put and get methods. I want to allow access to these methods based on pre-defined user permissions I have stored in a database. My question is, how…
doomblah
  • 77
  • 2
  • 10
1
vote
0 answers

Flask authentication decorators

Currently I'm using two types of authentication in my API: Local user + Local password DB user + DB password For this I want to define a decorator for each type.…
gogasca
  • 9,283
  • 6
  • 80
  • 125
1
vote
1 answer

Understand decorators on Flask-HTTPAuth

I want to understand how and when @auth.verify_password decorator is used on this program. If i navigate to route http://127.0.0.1:5000, I understand that I need to passed in a username and a password and @auth.login_required will verify it, but…
ellaRT
  • 1,346
  • 2
  • 16
  • 39
1
vote
2 answers

Python / Flask - Using flask_restless with flask_httpauth

my objective in this question is to secure my API. in my application, I'm using Flask and flask_restless's APIManager to provide CRUD API to my Person object. code sample: manager = APIManager(app, flask_sqlalchemy_db=db) manager.create_api(Person,…
Motassem Kassab
  • 1,744
  • 4
  • 21
  • 40
1
vote
1 answer

Basic Auth Header appears to be lost

I am writing a Flask RESTful server and an AngularJS client, and am running into an issue where it appears the username and password information are being lost in transmission, so to speak. In the Javascript console, I can tell that the client is…
1
vote
1 answer

Multiple verify_password callbacks on flask-httpauth

Working on a Flask application which will have separate classes of routes to be authenticated against: user routes and host routes(think Airbnb'esque where users and hosts differ substantially). Creating a single verify_password callback and…
Brent Hronik
  • 2,357
  • 1
  • 27
  • 43
1
vote
1 answer

Flask-HTTPAuth verify_password

I am stuck on flask-httpauth's verify_password. I have username and password script that hashes the password and puts it into a simple file. (Yes not the most secure but LDAP/LOGIN doesn't work correctly with Flask(Sandman.io) using my level of…
Nvasion
  • 620
  • 1
  • 8
  • 14
0
votes
1 answer

flask-HTTPTokenAuth Fails to Verify Token

I'm working my way through Miguel Grinberg's book Flask Web Development, and I've run into a snag in Chapter 14 (Application Programming Interfaces) with the authentication routine. I'm attempting to update the code to use the current version of…
Darwin von Corax
  • 5,201
  • 3
  • 17
  • 28
0
votes
1 answer

Authenticate once using a json field with Flask-HTTPAuth and Flask-RESTX

I have set up an API using configured with auth protected endpoints as described in this excellent tutorial https://blog.miguelgrinberg.com/post/restful-authentication-with-flask My end user, however, wants to authenticate by passing a JSON and then…