samedi 18 avril 2015

AWS EC2 server basic authentication

I am running a Flask web app using an AWS EC2 ubuntu server. I want to password protect my app using basic authentication. However, when I test the webpage and enter the username and password it doesn't seem to validate. The app just prompts me again to enter the information again and never authenticates me. The code seems to work when I am running it on my laptop but when I put it on the server this issue occurs which leads me to believe that the problem is with the server. How do I make the server I am using accept the basic authentication?


The code with which I am implementing basic authentication is:



app.config['BASIC_AUTH_USERNAME'] = 'user'
app.config['BASIC_AUTH_PASSWORD'] = 'password'

basic_auth = BasicAuth(app)
@app.route("/secret")
@basic_auth.required
def secret_view():
return submit.html




Aucun commentaire:

Enregistrer un commentaire