jpvanhal / flask-basicauth

HTTP basic access authentication for Flask.
https://flask-basicauth.readthedocs.io/
Other
85 stars 27 forks source link

Not supporting https://user:pass@server #27

Open dctim opened 4 years ago

dctim commented 4 years ago

I'm trying to figure out if flask-basicauth doesn't support this, or if I'm doing something wrong.

With other http / apache Basic Auth you can get straight to the site through embedding the user/pass into the URL like: http://user:pass@server Is this possible? I haven't made it work yet. Below is my code. ` from flask_basicauth import BasicAuth app = flask.Flask(name) CORS(app)

CORS(app, expose_headers='Authorization'). #Did not work

app.config['BASIC_AUTH_USERNAME'] = 'user' app.config['BASIC_AUTH_PASSWORD'] = 'pass' app.config['BASIC_AUTH_FORCE'] = True basic_auth = BasicAuth(app)

@app.route('/', methods=['GET']) def hello(): return '''Running''' `

mdavis-xyz commented 1 year ago

That should be possible. My understanding is that the client should extract the password and put it in a header for you. So this library can't tell the difference.