How does authentication work? Learn how password hashing, MFA, passkeys, and session cookies protect accounts, and where login security can fall short.
👉 Master your Security+ skills with Pluralsight here: Pluralsight
You’ll learn how user authentication works, from password hashing and multi-factor authentication (MFA) to passkeys and session cookies. Build your CompTIA Security+ foundation, understand authentication versus authorization, and spot security risks beyond the login screen.
Chapters: 0:00 Intro 0:14 What does user authentication actually prove? 0:54 How does a website verify your password? 1:46 What makes multi-factor authentication different? 3:01 How do passkeys resist phishing? 3:37 Why do sessions and account recovery matter? 4:26 Outro
Affiliate notice: Some links may earn a commission. Thanks for your support.
Key Takeaways
Authentication verifies control of an account’s authenticator; authorization determines permitted actions. A successful login does not grant unrestricted access.
Secure password storage uses salted, costly password hashing, not reversible encryption. Hashes still permit offline guessing after a breach, so use long, unique passwords. See OWASP’s guidance.
MFA requires distinct factor categories, such as a password plus an authenticator app. A password followed by a PIN is not MFA.
FIDO passkeys and security keys resist credential phishing better than manually entered codes. Passkeys use cryptographic signatures rather than sharing a reusable website password; HTTPS alone does not make a login page trustworthy.
Passwordless does not automatically mean MFA. Passkeys can combine possession with a locally verified PIN or biometric; synced passkeys are not restricted to one device.
Stolen session credentials can bypass another MFA prompt. Secure cookies, expiration, revocation, and endpoint protection remain essential after login.
SSO relies on an identity provider’s authentication result. SAML and OpenID Connect support federated sign-in; OAuth 2.0 alone is a delegated authorization framework.
Recovery must be protected as carefully as login. Secure your recovery email and codes, prepare for authenticator loss, and revoke lost or compromised authenticators.
👉 Turn authentication concepts into practical skills with Pluralsight, an optional next step offering guided security labs, feedback, assessments, and certification practice.
User authentication works by checking evidence that you control an account’s password, security key, or another registered authenticator. If the evidence is valid, the service can establish a session so you can continue using it without signing in on every page.
But a successful login is only one part of account security. Permissions, session protection, and account recovery all matter after authentication succeeds.
Authentication vs. Authorization: What Does a Login Prove?
Authentication does not necessarily prove your real-world identity. It establishes evidence that you control an authenticator associated with an account, even if that account uses a pseudonym.
Some links may earn a commission. Thanks for your support.
Watch in the video playerOpen the dedicated player for this course.
Process
Question it answers
Example
Identification
Which account are you claiming?
Entering your username or email address.
Authentication
Can you prove control of that account’s authenticator?
Providing a password or using a registered passkey.
Authorization
What is this account allowed to do?
Viewing payroll information without permission to change salaries.
Logging into a company portal does not mean you can give yourself a raise. Authentication establishes the account context; authorization controls the actions available within it.
For cybersecurity and CompTIA Security+ learners, this distinction is foundational. Systems must continue checking permissions after login rather than treating authentication as unrestricted access.
How Does Authentication Work During a Typical Login?
A password-and-authenticator-app login commonly follows this sequence:
Enrollment: The service creates your account and associates it with password-verification data and an enrolled second-factor authenticator.
Protected connection: Your browser connects using HTTPS, which protects information in transit to the domain you are visiting.
Account identification: You enter a username or another account identifier.
Password verification: The server checks your submitted password against its stored verification data.
Second-factor verification: The service checks additional evidence, such as a code from your authentication app.
Session creation: After successful authentication and applicable policy checks, the application issues a session credential.
Continued access: Your browser presents that credential on later requests, while the application checks your permissions.
Session termination: Logout, expiration, or revocation ends access under that session.
Not every login uses passwords or follows exactly this sequence. Passkeys, for example, replace password verification with a cryptographic exchange.
HTTPS is necessary, but it does not make a login page trustworthy by itself. A phishing website can also use HTTPS. The connection may be encrypted while still leading to the wrong destination.
How Websites Verify Passwords Without Storing Readable Copies
A properly designed service stores a password hash, not a readable or recoverable copy of your password.
A password hash is a derived value produced by a password-hashing algorithm. Unlike encryption, password hashing is not designed to be reversed.
What Happens During Registration?
When you create a password, the service:
Receives it over a protected connection.
Generates a unique random value called a salt.
Processes the password and salt using a suitable password-hashing function and cost settings.
Stores the resulting verifier, salt, and necessary algorithm parameters.
The salt is not a secret. Its purpose is to prevent identical passwords from producing identical stored results when the other settings are the same.
What Happens When You Sign In?
The service retrieves your account’s salt and hashing parameters, processes the password you submitted, and checks whether the result matches the stored verifier.
It does not decrypt the hash.
Password-hashing algorithms deliberately make this calculation expensive. That increases the cost of trying large numbers of guesses against a stolen password database. OWASP’s password-storage guidance recommends algorithms designed for this purpose, such as Argon2id, rather than a fast general-purpose hash alone.
However, hashing does not make weak passwords safe. If attackers steal password verifiers, they can still test guesses offline. A salt does not magically strengthen password123.
For users, long, unique passwords reduce guessing and password-reuse risks. A password manager can help maintain a different password for each account.
What Makes Multi-Factor Authentication Different?
Multi-factor authentication, or MFA, requires evidence from distinct factor categories. It is not simply a login process with multiple screens.
The three principal categories are:
Factor
Meaning
Examples
Something you know
A secret you know.
Password, passphrase, PIN.
Something you have
Control of an enrolled authenticator.
Security key, smart card, code-generating app.
Something you are
A biometric characteristic.
Fingerprint or facial characteristics.
A password followed by a PIN uses the knowledge category twice. That is not MFA.
A password plus a code from an enrolled authentication app combines knowledge and possession. Although you type the code, it demonstrates control of an authenticator containing the enrolled secret.
Two-factor authentication, or 2FA, is MFA using exactly two factors.
Why Some MFA Methods Are Stronger Than Others
MFA improves security, but different methods resist different attacks.
Method
How it helps authenticate you
Important limitation
Authenticator-app code
Generates a short-lived code using an enrolled secret and time.
A phishing site can capture and immediately relay the code.
Push approval
Sends an approval request to an enrolled app.
Repeated prompts can pressure or confuse someone into approving.
SMS code
Sends a code to a phone number.
Vulnerable to phishing, SIM swapping, and telecommunications attacks.
FIDO passkey or security key
Signs a challenge using a private key associated with the legitimate service.
Endpoint, session, enrollment, and recovery security still matter.
A one-time code may prevent later reuse while still being usable by an attacker in real time. Likewise, number matching improves basic push approval but does not make it phishing-resistant.
CISA’s guidance on phishing-resistant MFA explains why FIDO/WebAuthn authentication offers stronger protection against credential phishing than manually entered codes.
How Do Passkeys Work?
Passkeys replace a reusable website password with public-key authentication.
During registration, an authenticator creates a matched pair of cryptographic keys:
The public key is registered with the service.
The private key stays protected by the authenticator or passkey provider.
The public key lets the service verify a signature. It does not let the service generate the private key’s signatures.
The Passkey Login Process
A typical passkey login works like this:
The service sends a fresh challenge.
Your browser and authenticator process the request for that service.
You authorize the operation, potentially using a fingerprint, facial recognition, or a local PIN.
The authenticator signs the challenge and relevant contextual data.
The service verifies the signature using your registered public key and checks the expected context.
In this flow, the website receives cryptographic evidence, not your fingerprint or local device PIN.
Why Passkeys Resist Phishing
Properly implemented FIDO authentication binds credential use to the legitimate service. A lookalike website cannot simply collect a reusable password or temporary code and replay it at the real website.
The private key is not sent to the website.
There are two important passkey models:
Device-bound passkeys remain tied to a particular authenticator.
Synced passkeys can become available on other devices through a passkey provider’s protected synchronization system.
That means “a passkey’s private key never leaves the original device” is not universally accurate. The FIDO Alliance’s passkey guidance distinguishes synced and device-bound credentials.
Also, passwordless does not automatically mean MFA. A passkey can demonstrate possession plus a locally verified PIN or biometric when user verification is required.
How Session Cookies Keep You Signed In
Authentication is an event. A session maintains continuity afterward.
Without session management, a website would need another way to authenticate your requests every time you opened a page or performed an action.
A common approach works like this:
You authenticate successfully.
The server creates an authenticated session.
The browser receives an unpredictable session identifier in a cookie.
Later requests include that cookie.
The server uses the identifier to recognize the session and checks whether the requested action is permitted.
A cookie is a browser storage and transport mechanism; not every cookie is an authentication credential. But a cookie containing a usable session identifier can be security-sensitive.
Why Session Theft Can Bypass Another MFA Prompt
If an attacker steals a usable bearer session credential, they may be able to impersonate the already-authenticated session without repeating the password or MFA exchange.
This does not mean MFA was useless. It means the attacker targeted a different stage of account access.
Important session protections include:
HTTPS throughout the session.
Appropriate cookie attributes, including Secure, HttpOnly, and SameSite.
Session-identifier renewal after authentication or privilege changes.
Session expiration and revocation.
Endpoint security to reduce credential theft from the user’s device.
Applications must also continue enforcing authorization. A valid session should not grant access to every record or administrative action.
How Single Sign-On Fits Into Authentication
With single sign-on, or SSO, authenticating once enables access to multiple services without separately entering credentials for each one.
In a typical federated sign-in:
An application directs you to an identity provider.
The identity provider authenticates you.
It returns an assertion or token that the application validates.
The application establishes its own session.
The application relies on the identity provider’s authentication result rather than directly receiving your identity-provider password.
Two common technologies are SAML and OpenID Connect, or OIDC. OIDC adds an identity layer on top of OAuth 2.0.
The distinction matters: OAuth 2.0 is a delegated authorization framework, not a user-authentication protocol by itself. Granting an application access to selected resources and proving who signed in are related but different tasks.
Why Account Recovery Is Part of Authentication Security
Account recovery is an alternative route to account control. If that route is easier to impersonate than the normal login, strong authentication can be undermined.
For example, a service may offer strong MFA but allow an attacker to replace the enrolled authenticator through a poorly protected recovery process.
Practical precautions include:
Protect your recovery email. It may receive password-reset links and security notifications.
Store recovery codes securely. They are sensitive credentials, not harmless reference numbers.
Plan for authenticator loss. Where supported, enroll an additional authenticator or maintain a secure recovery method.
Review unexpected security notifications. An unfamiliar authenticator enrollment or recovery change may indicate compromise.
Revoke lost or compromised authenticators. Replacement alone does not necessarily remove the old credential’s access.
Services should use unpredictable, limited-lifetime, single-use password-reset tokens and carefully verify security-sensitive changes. OWASP’s recovery guidance also advises against relying on security questions as the sole recovery mechanism.
Recognizing Authentication Risks Beyond the Login Screen
Different attacks target different parts of the authentication lifecycle:
The useful mental model is a chain: enrollment, authentication, session management, authorization, and recovery. Each link needs protection. A strong login method cannot compensate for unrestricted permissions or an easily hijacked recovery process.
Build Hands-On Authentication Skills
Understanding password hashing, MFA, passkeys, and session cookies gives you a foundation for further cybersecurity study. Practice helps you apply those distinctions and identify gaps in your understanding.
Pluralsight is an optional next step with guided security labs, feedback, assessments, and certification practice resources to help turn these concepts into practical skills.
Affiliate notice: Some links may earn a commission. Thanks for your support.
Password Expiration Policy: Should Passwords Expire? (Explained Clearly)Next
FAQ
Quick answers to the questions people usually ask about this topic.
Does changing my password sign out someone who has accessed my account?
Not necessarily. Changing your password can stop future logins with the old password, but an existing session may remain usable unless the service revokes it. If you suspect compromise, use any available sign out of all devices option, review enrolled authenticators, and check your recovery settings as well as changing the password.
Is it still MFA if my password and authenticator app are on the same phone?
Yes. A password and an enrolled authenticator app can represent two distinct factors: knowledge and possession. MFA depends on the factor categories, not simply the number of devices. However, keeping both on one phone concentrates risk: a compromised device could expose passwords, authenticator access, or an already-signed-in session.
What happens if I lose the device that holds my passkeys?
Your options depend on how your passkeys are stored and what recovery methods the service supports. A synced passkey may be available through your passkey provider on another device, while a device-bound passkey stays tied to its authenticator. Before losing access, enroll an additional authenticator or set up a secure recovery method where supported. After a loss, revoke the missing device’s credential when appropriate. The FIDO Alliance’s passkey guidance explains the different passkey models.
Does signing out of an SSO provider also sign me out of every connected app?
Not always. In a typical single sign-on flow, each application establishes its own session after validating the identity provider’s response. Signing out of the provider therefore does not guarantee that every application session ends. The result depends on the services’ logout and revocation mechanisms; on a shared or compromised device, sign out of the individual applications too.
What should I do if I receive an MFA approval request I did not initiate?
Do not approve it or share any verification code. Open the service through its known website or official app, not a link in an unexpected message, and review recent account activity, active sessions, authenticators, and recovery settings. An unexpected request can indicate an attempted sign-in, though it does not by itself prove the attacker has gained access.
Why do I still need a unique password if a website stores password hashes?
Hashing protects stored verification data; it does not prevent attackers from testing guesses against a stolen password database. If a reused password is exposed or cracked at one service, attackers can try it elsewhere through credential stuffing. Use a long, unique password for each account, ideally managed with a password manager, and enable strong MFA or passkeys where available.
How can I practice authentication concepts for CompTIA Security+ beyond watching explanations?
Practice tracing a login from enrollment through session termination, distinguishing authentication from authorization, and matching attacks to appropriate controls. For structured hands-on learning, explore Pluralsight as an optional next step. Its guided security labs, feedback, assessments, and certification practice resources can help you apply foundational concepts and identify gaps for your next study session.
Affiliate link — I may earn a commission at no additional cost to you.
Jay's Recommendation
Turn understanding into hands-on confidence
You've built the foundations. Pluralsight adds opportunities to practice in guided security labs, get feedback, and check your knowledge with assessments and practice exams, so your next step is more than another video.
🛠Put concepts to workBuild practical skills with guided security labs and feedback.
🎯Find your weak spotsUse assessments to focus on what needs more work.
📝Check your understandingUse practice exams to guide your certification preparation.
🧭Give study sessions directionOrganize further learning with curated paths and progress tracking.