flask icon indicating copy to clipboard operation
flask copied to clipboard

Tutorial stores passwords in plaintext

Open ssbr opened this issue 13 years ago • 10 comments

http://flask.pocoo.org/docs/tutorial/views/#login-and-logout

Flask should not lead new users astray, and should instead make it as easy and obvious as possible to do the right thing.

ssbr avatar Aug 14 '13 21:08 ssbr

The problem is that covering auth frameworks in a tutorial will distract the user from the goal of learning the basics of Flask.

untitaker avatar Aug 14 '13 22:08 untitaker

Werkzeug has crypto stuff for passwords, we could use that at least.

DasIch avatar Aug 14 '13 22:08 DasIch

Should a primer on https be covered too? Even if you store passwords encrypted, new users still won't be building secure applications without encrypting stuff over the wire.

cpdean avatar Aug 15 '13 01:08 cpdean

@untitaker even if this isn't part of the basics of flask per se, it is part of the basics of using flask. Maybe that semantic wrangling is sufficient? ;)

ssbr avatar Aug 15 '13 07:08 ssbr

@cpdean HTTPS is something the web server should do for you and therefore depends on your method of deployment. If we add HTTPS to the tutorial, we either end up with a lot of "ifs" in the tutorial or have to implicitly endorse one particular method. I don't think either is appropriate.

Adding information about how to use HTTPS in the "Deployment Options" section, even just by linking to the documentation that covers this in the documentation of the respective server would probably be a good idea. We could then mention in which cases people should use HTTPS in the tutorial in a more abstract manner.

DasIch avatar Aug 15 '13 11:08 DasIch

I've been looking into this issue. Should Werkzeug be mentioned for its ability to hash + salt passwords to avoid storing plain text user login information?

KWinston avatar Mar 13 '15 03:03 KWinston

Sorry to respond after you made the PR, but I think we could solve this problem and also take care of #532 at the same time: Mention extensions that are for password hash storage and validation.

untitaker avatar Mar 13 '15 20:03 untitaker

Working on this during the pycon sprint!

wldtyp avatar Jun 02 '16 17:06 wldtyp

Thanks, feel free to ask questions here.

untitaker avatar Jun 02 '16 17:06 untitaker

@wldtyp don't forget to submit your improvements as a pull request

jeffwidman avatar Jun 02 '16 22:06 jeffwidman