You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: cheatsheets/Authentication_Cheat_Sheet.md
+16-19Lines changed: 16 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -87,34 +87,34 @@ In order to mitigate CSRF and session hijacking, it's important to require the c
87
87
88
88
### Reauthentication After Risk Events
89
89
90
-
**Overview:**
90
+
**Overview:**
91
91
Reauthentication is critical when an account has experienced high-risk activity such as account recovery, password resets, or suspicious behavior patterns. This section outlines when and how to trigger reauthentication to protect users and prevent unauthorized access. For further details, see the [Require Re-authentication for Sensitive Features](#require-re-authentication-for-sensitive-features) section.
92
92
93
93
#### When to Trigger Reauthentication
94
94
95
-
-**Suspicious Account Activity**
95
+
-**Suspicious Account Activity**
96
96
When unusual login patterns, IP address changes, or device enrollments occur
97
-
-**Account Recovery**
97
+
-**Account Recovery**
98
98
After users reset their passwords or change sensitive account details
99
-
-**Critical Actions**
99
+
-**Critical Actions**
100
100
For high-risk actions like changing payment details or adding new trusted devices
101
101
102
102
#### Reauthentication Mechanisms
103
103
104
-
-**Adaptive Authentication**
104
+
-**Adaptive Authentication**
105
105
Use risk-based authentication models that adapt to the user's behavior and context
106
-
-**Multi-Factor Authentication (MFA)**
106
+
-**Multi-Factor Authentication (MFA)**
107
107
Require an additional layer of verification for sensitive actions or events
108
-
-**Challenge-Based Verification**
108
+
-**Challenge-Based Verification**
109
109
Prompt users to confirm their identity with a challenge question or secondary method
110
110
111
111
#### Implementation Recommendations
112
112
113
-
-**Minimize User Friction**
113
+
-**Minimize User Friction**
114
114
Ensure that reauthentication does not disrupt the user experience unnecessarily
115
-
-**Context-Aware Decisions**
115
+
-**Context-Aware Decisions**
116
116
Make reauthentication decisions based on context (e.g., geolocation, device type, prior patterns)
117
-
-**Secure Session Management**
117
+
-**Secure Session Management**
118
118
Invalidate sessions after reauthentication and rotate tokens—see the [OWASP Session Management Cheat Sheet](https://cheatsheetseries.owasp.org/cheatsheets/Session_Management_Cheat_Sheet.html)
119
119
120
120
#### References
@@ -305,24 +305,21 @@ While authentication through a combination of username, password, and multi-fact
305
305
306
306
### OAuth 2.0 and 2.1
307
307
308
-
OAuth is an **authorization** framework for delegated access to APIs.
308
+
OAuth is an **authorization** framework for delegated access to APIs. See also: [OAuth 2.0 Cheat Sheet](OAuth2_Cheat_Sheet.md).
309
309
310
-
See also: [OAuth 2.0 Cheat Sheet](OAuth2_Cheat_Sheet.md).
311
-
312
-
> **Note on OAuth 2.1:** OAuth 2.1 is an IETF Working Group draft that consolidates OAuth 2.0 and widely adopted best practices and is intended to replace the core OAuth 2.0 RFCs. Guidance in this cheat sheet applies to both OAuth 2.0 and OAuth 2.1.
> **Note:** OAuth 2.1 is an IETF Working Group draft that consolidates OAuth 2.0 and widely adopted best practices and is intended to replace RFC 6749/6750; guidance in this cheat sheet applies to both OAuth 2.0 and OAuth 2.1. References: [draft-ietf-oauth-v2-1-13](https://datatracker.ietf.org/doc/html/draft-ietf-oauth-v2-1-13), [oauth.net/2.1](https://oauth.net/2.1/)
314
311
315
312
### OpenID Connect (OIDC)
316
313
317
-
**OpenID Connect 1.0 (OIDC)** is an identity layer **on top of OAuth**. It defines how a client (**relying party**) verifies the **end user’s** identity using an **ID Token** (a signed JWT) and how to obtain user claims in an interoperable way. Use **OIDC for authentication/SSO**; use **OAuth for authorization** to APIs.
314
+
**OpenID Connect 1.0 (OIDC)** is an identity layer **on top of OAuth**. It defines how a client (**relying party**) verifies the **end user's** identity using an **ID Token** (a signed JWT) and how to obtain user claims in an interoperable way. Use **OIDC for authentication/SSO**; use **OAuth for authorization** to APIs.
315
+
316
+
#### OIDC implementation guidance
318
317
319
-
**Implementation guidance**
320
318
-**Validate ID Tokens** on the relying party: issuer (`iss`), audience (`aud`), signature (per provider JWKs), expiration (`exp`).
321
319
- Prefer **well-maintained libraries/SDKs** and provider discovery/JWKS endpoints.
322
320
- Use the **UserInfo** endpoint when additional claims beyond the ID Token are required.
323
321
324
-
> **Avoid confusion:****OpenID 2.0 (“OpenID”)** was a separate, legacy authentication protocol that has been **superseded by OpenID Connect** and is considered obsolete. New systems should not implement OpenID 2.0.
> **Avoid confusion:****OpenID 2.0 ("OpenID")** was a separate, legacy authentication protocol that has been **superseded by OpenID Connect** and is considered obsolete. New systems should not implement OpenID 2.0. References: [OpenID Foundation — obsolete OpenID 2.0 libraries](https://openid.net/developers/libraries-for-obsolete-specifications/), [OpenID 2.0 → OIDC migration](https://openid.net/specs/ope)
0 commit comments