Giter Club home page Giter Club logo

Comments (5)

miguelgrinberg avatar miguelgrinberg commented on June 7, 2024

This is currently not possible, but you are not the first to request this. The problem is that the current version of the extension will directly return a 401 error when the request does not include the authorization header. The change that I was planning to make was to allow the password validation password to be called even when the header is missing. You can then return True from the password validation callback and set something in flask.g to indicate to the route that there is no user authenticated.

from flask-httpauth.

fyears avatar fyears commented on June 7, 2024

But still, it seems that your solution right now still requires an auth header in the request, or it would abort 401 anyway.

from flask-httpauth.

miguelgrinberg avatar miguelgrinberg commented on June 7, 2024

Correct, this requires a change that I was considering for the future, it
is not possible right now. I'll try to look into it tomorrow.
On Feb 4, 2015 11:25 PM, "fyears" [email protected] wrote:

But still, it seems that your solution right now still requires an auth
header in the request, or it would abort 401 anyway.


Reply to this email directly or view it on GitHub
#17 (comment)
.

from flask-httpauth.

miguelgrinberg avatar miguelgrinberg commented on June 7, 2024

Addressed in version 2.4.0. In this version for requests that don't have an Authorization header the extension calls the verify_password() callback with username and password set to empty strings. You can opt to return True and that will let the request through. You can write something to flask.g so that the route know the user is anonymous.

from flask-httpauth.

fyears avatar fyears commented on June 7, 2024

Thank you.

Just a reference, this issue is solved in commit 5c5396b .

from flask-httpauth.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.