A login system answers more than one question.
Two of the most important are:
Who are you?
What are you allowed to do?
Those are different jobs.
Authentication
Authentication establishes identity.
A username and password can be one authentication method.
Other methods can include passkeys, security keys, one-time codes and external identity providers.
Authorization
Authorization determines what an authenticated identity is permitted to access or change.
A person can be correctly logged in and still be prohibited from entering an administrator area.
That is normal.
Authentication says who the user is.
Authorization says what that user may do.
Sessions
Websites need a way to remember that a user has already authenticated.
A session provides temporary state that can connect later requests with the authenticated user.
Cookies
Browsers can store cookies and return them with later requests according to the cookie’s rules.
A session system often uses a cookie containing a session identifier.
The cookie should not need to contain the user’s actual password.
Password storage
A responsible system should not need to store ordinary readable passwords.
Passwords should be processed using password-hashing functions designed for password storage.
When the user logs in, the system verifies the supplied password against the stored password hash.
Password reset
A password-reset system should not email the existing password back to the user.
A better design proves control of an approved recovery method and provides a limited opportunity to set a new password.
Reset links or codes should be time limited and designed against reuse.
Multi-factor authentication
MFA requires more than one authentication factor.
This reduces the damage that can occur when a password alone is stolen.
Single sign-on
Single sign-on allows one authentication system to establish access across multiple connected services.
The exact architecture can vary greatly.
The important idea is that each application does not necessarily need to maintain an entirely separate login identity.
OAuth
OAuth is primarily an authorization framework.
It is commonly involved when one service grants another service limited access without giving that service the user’s password.
OAuth is frequently seen beside login systems, which is why it is sometimes casually described as authentication even though authorization is its central purpose.
Recovery is part of account design
A login system is incomplete if nobody has planned for:
forgotten passwords
lost email access
lost MFA devices
compromised accounts
role changes
locked accounts
account deletion
Account systems are infrastructure.
The login form is only the visible front door.
Put This Lesson to Work
Choose a real website or project you control. Identify where this lesson applies, record who is responsible for that part, and identify one change or check you can safely make.
Worked example
For a domain-email lesson, record the separate website and email providers. Look up the existing MX records without changing them, then confirm which provider receives mail.
Your finished result
A short explanation of the system, its owner, and a checked next action. Keep passwords and recovery codes out of your notes.
Check your understanding
- Can you explain the main idea without repeating a slogan?
- What evidence or example supports your explanation?
- Which decision will you make differently, and why?