diff options
Diffstat (limited to 'session_app.py.publish')
-rwxr-xr-x | session_app.py.publish | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/session_app.py.publish b/session_app.py.publish index 31df674..adfd0ad 100755 --- a/session_app.py.publish +++ b/session_app.py.publish @@ -13,8 +13,6 @@ # Improve: # move all configs to config file # move all references to references section -# make /login/basic actually request http auth if user/pw not provided, or is a GET -# try inspecting flask-httpauth auth.login_required section? # accept a bind credential so we can perform lookups of users who match "uid=%s" under a basedn. # accept a ldap dns domain name, and a SRV lookup for _tcp._ldap # Run: @@ -267,11 +265,11 @@ def logout(): resp.set_cookie('timestamp','',expires=0) return resp -@app.route("/login/basic",methods=['POST']) -@app.route("/login/basic/",methods=['POST']) +@app.route("/login/basic",methods=['POST','GET']) +@app.route("/login/basic/",methods=['POST','GET']) def login_basic(): if not request.authorization: - return Response(f"No username and password provided.",401) + return Response(f"Please provide username and password.",401,{'WWW-Authenticate': 'Basic'}) if 'username' not in request.authorization: return Response(f"No username provided.",401) if 'password' not in request.authorization: |