Skip to content

Conversation

wbamberg
Copy link
Collaborator

@wbamberg wbamberg commented Oct 19, 2025

@github-actions github-actions bot added Content:Security Security docs size/m [PR only] 51-500 LoC changed labels Oct 19, 2025

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:

```
Copy link
Contributor

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: "```"]

Copy link
Contributor

github-actions bot commented Oct 19, 2025

Preview URLs

Flaws (2)

URL: /en-US/docs/Web/Security/Authentication/Passwords
Title: Passwords
Flaw count: 2

  • broken_links:
    • Can't resolve /en-US/docs/Web/Security/Authentication/OTP
    • Can't resolve /en-US/docs/Web/Security/Authentication/Passkeys
External URLs (18)

URL: /en-US/docs/Web/Security/Authentication/Passwords
Title: Passwords

(comment last updated: 2025-10-20 21:32:48)

@wbamberg wbamberg marked this pull request as ready for review October 19, 2025 23:44
@wbamberg wbamberg requested a review from a team as a code owner October 19, 2025 23:44
@wbamberg wbamberg requested review from Elchi3 and chrisdavidmills and removed request for a team October 19, 2025 23:44
Copy link
Contributor

@chrisdavidmills chrisdavidmills left a 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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.

![Registration using a password.](password-basic-register.svg)
Copy link
Contributor

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.
Copy link
Contributor

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/)
Copy link
Contributor

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Content:Security Security docs size/m [PR only] 51-500 LoC changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants