-
Notifications
You must be signed in to change notification settings - Fork 22.9k
Add a guide on password-based authentication #41594
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
||
If the website is intending to use email in the password reset flow, then the server must also check that the email address belongs to the user signing up. To do this, the server typically generates a random token and sets it as a parameter to a verification URL: | ||
|
||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[markdownlint] reported by reviewdog 🐶
MD040/fenced-code-language Fenced code blocks should have a language specified [Context: "```"]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice article @wbamberg; nicely written, and I found it interesting.
I've got a bunch of nitpicks for you to sift through, but nothing major.
|
||
In a password authentication system, when the user registers: | ||
|
||
1. The user supplies a new username and password, for example by entering it in a {{htmlelement("form")}} element in the website. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1. The user supplies a new username and password, for example by entering it in a {{htmlelement("form")}} element in the website. | |
1. The user supplies a new username and password, for example, by entering it in a {{htmlelement("form")}} element in a website. |
2. The web page sends the username and password to the server, for example by submitting the form in a {{httpmethod("POST")}} request. | ||
3. The server creates a new record for this user in its database. The key is the username and the password is stored under it. | ||
|
||
 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a heads-up that these images aren't displaying in the live preview. If they are OK in your local environment, I'm sure all is good.
|
||
1. The user supplies the username and password. | ||
2. The web page sends the username and password to the server. | ||
3. The server retrieves the stored password for the user, and compares the stored password with the one it just received. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be worth adding a fourth point along the lines of "If the passwords match, the user is signed in"?
|
||
For more information, see: | ||
|
||
- [Everything you ever wanted to know about building a secure password reset feature](https://www.troyhunt.com/everything-you-ever-wanted-to-know/) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consistency: in the previous troyhunt.com link, you name the author in the link text.
Co-authored-by: Chris Mills <chrisdavidmills@gmail.com>
Adds a guide on password-based authentication. Part of https://docs.google.com/document/d/1miZbXVjs070J2HH0rsDxqPnUaqNtPP51Uo8d4FU6PTk/edit?tab=t.0#heading=h.kbs51irq6pyz.