learning, development, azure, dotnet, conference, documentation
Passkey Authentication Information
What are Passkeys?
Passkeys are a modern, secure authentication method that completely replaces traditional passwords with cryptographic credentials.
They represent a revolutionary approach to user authentication, leveraging public-key cryptography to provide a more secure, user-friendly, and phishing-resistant authentication experience.
How Passkeys Work
Core Technology
Passkeys are built on the FIDO2/WebAuthn standard and use public-key cryptography principles:
- Key Pair Generation: When you create a passkey, your device generates a unique cryptographic key pair:
- Private Key: Stored securely on your device (never leaves the device)
- Public Key: Shared with the service you’re registering with
- Authentication Process:
- The service sends a challenge to your device
- Your device uses the private key to sign the challenge
- The service verifies the signature using the stored public key
- If verification succeeds, you’re authenticated
Security Features
Phishing Resistance
- Domain Binding: Passkeys are cryptographically bound to specific domains
- No Shared Secrets: Unlike passwords, there’s no secret that can be intercepted or stolen
- Challenge-Response: Each authentication uses a unique challenge, preventing replay attacks
Application Scoping
- Site-Specific: Each passkey is unique to the specific website or application
- No Cross-Application Sharing: A passkey for one service cannot be used for another
- Isolation: Compromising one service doesn’t affect other services
Important Clarification: While each site requires its own unique passkey, this doesn’t mean you need to authenticate every time you visit that site. The passkey is just the key
- once you use it to unlock the door (authenticate), you stay inside
(logged in) until the session expires.
Passkeys vs. JWT Bearer Tokens: A Common Comparison
How Passkeys Are Similar to JWT Bearer Tokens
Many developers compare passkeys to JWT bearer tokens, and there are indeed some similarities:
- Site-Specific: Like JWT tokens, each passkey is unique to a specific site/application
- No Cross-Site Usage: Just like you can’t use a JWT from Site A to authenticate to Site B
- Authentication Proof: Both prove identity to the target service
- Stateless Authentication: Both enable authentication without storing sensitive data server-side
however please consider they are fundamentally different in how they in their purpose and usage: : | Aspect | JWT Bearer Tokens | Passkeys | |——–|——————|———-| | Storage | Often stored in browser/app memory | Stored securely in device hardware/OS | | Generation | Generated by server after login | Generated by device during registration (and used during login) | | Transmission | Sent with every API request | Only used during authentication ceremony | | Lifetime | Have expiration times (minutes/hours) | Permanent until manually revoked | | Security | Can be intercepted if not secured | Cryptographically impossible to intercept | | Usage Pattern | Continuous usage for API calls | One-time usage for session establishment |
The Authentication Flow Comparison
JWT Bearer Token Flow: 1. Login with username/password → Server generates JWT 2. Store JWT in browser/app 3. Send JWT with every subsequent API request 4. Server validates JWT on each request
Passkey Flow: 1. One-time registration → Device generates key pair 2. Store private key securely on device 3. Authentication challenge → Sign with private key 4. Server validates signature → Creates normal web session (cookies)
Passkeys + JWT Tokens: Working Together
Key Point: Passkeys replace passwords for authentication, but servers can still generate JWT tokens afterward for API access - giving you secure login plus efficient ongoing communication.