11# Best Practices {#recommendations}
2-
2+
33This section describes the set of security mechanisms and measures the OAuth
44working group considers best practices at the time of writing.
55
@@ -27,13 +27,13 @@ the `nonce` parameter provides CSRF protection. Otherwise, one-time
2727use CSRF tokens carried in the ` state ` parameter that are securely
2828bound to the user agent MUST be used for CSRF protection (see
2929(#csrf_countermeasures)).
30-
30+
3131When an OAuth client can interact with more than one authorization server, a
3232defense against mix-up attacks (see (#mix_up)) is REQUIRED. To this end, clients
33- SHOULD
33+ SHOULD
3434
3535 * use the ` iss ` parameter as a countermeasure according to
36- [ @!RFC9207] , or
36+ [ @!RFC9207] , or
3737 * use an alternative countermeasure based on an ` iss ` value in the
3838 authorization response (such as the ` iss ` Claim in the ID Token in
3939 [ @!OpenID.Core] or in [ @JARM ] responses), processing it as described in
@@ -54,15 +54,15 @@ Clients MUST prevent authorization code
5454injection attacks (see (#code_injection)) and misuse of authorization codes using one of the following options:
5555
5656 * Public clients MUST use PKCE [ @!RFC7636] to this end, as motivated in
57- (#pkce_as_injection_protection).
57+ (#pkce_as_injection_protection).
5858 * For confidential clients, the use of PKCE [ @!RFC7636] is RECOMMENDED, as it
5959 provides a strong protection against misuse and injection of authorization
6060 codes as described in (#pkce_as_injection_protection) and, as a side-effect,
6161 prevents CSRF even in presence of strong attackers as described in
62- (#csrf_countermeasures).
62+ (#csrf_countermeasures).
6363 * With additional precautions, described in (#nonce_as_injection_protection),
6464 confidential OpenID Connect [ @!OpenID.Core] clients MAY use the ` nonce ` parameter and the
65- respective Claim in the ID Token instead.
65+ respective Claim in the ID Token instead.
6666
6767In any case, the PKCE challenge or OpenID Connect ` nonce ` MUST be
6868transaction-specific and securely bound to the client and the user agent in
@@ -97,20 +97,20 @@ the client to detect PKCE support). ASs MAY instead provide a
9797deployment-specific way to ensure or determine PKCE support by the AS.
9898
9999### Implicit Grant {#implicit_grant_recommendation}
100-
100+
101101The implicit grant (response type "token") and other response types
102102causing the authorization server to issue access tokens in the
103103authorization response are vulnerable to access token leakage and
104104access token replay as described in (#insufficient_uri_validation),
105105(#credential_leakage_referrer), (#browser_history), and
106106(#access_token_injection).
107-
108- Moreover, no viable method for sender-constraining exists to
107+
108+ Moreover, no viable method for sender-constraining exists to
109109bind access tokens to a specific client (as recommended in
110110(#token_replay_prevention)) when the access tokens are issued in the
111111authorization response. This means that an attacker can use leaked or stolen
112112access token at a resource endpoint.
113-
113+
114114In order to avoid these issues, clients SHOULD NOT use the implicit
115115grant (response type "token") or other response types issuing
116116access tokens in the authorization response, unless access token injection
@@ -129,7 +129,7 @@ sender-constrain the issued tokens (see next section).
129129## Token Replay Prevention {#token_replay_prevention}
130130
131131### Access Tokens
132-
132+
133133A sender-constrained access token scopes the applicability of an access
134134token to a certain sender. This sender is obliged to demonstrate knowledge
135135of a certain secret as prerequisite for the acceptance of that token at
@@ -164,7 +164,7 @@ the access token with certain resource servers and every resource
164164server is obliged to verify, for every request, whether the access
165165token sent with that request was meant to be used for that particular
166166resource server. If not, the resource server MUST refuse to serve the
167- respective request. The ` aud ` claim as defined in [ @!RFC9068] MAY be
167+ respective request. The ` aud ` claim as defined in [ @!RFC9068] MAY be
168168used to audience-restrict access tokens. Clients and authorization servers MAY utilize the
169169parameters ` scope ` or ` resource ` as specified in [ @!RFC6749] and
170170[ @RFC8707 ] , respectively, to determine the
@@ -211,10 +211,10 @@ methods more robust against a number of attacks.
211211## Other Recommendations
212212
213213The use of OAuth Metadata [ @!RFC8414] can help to improve the security of OAuth
214- deployments:
214+ deployments:
215215
216216 * It ensures that security features and other new OAuth features can be enabled
217- automatically by compliant software libraries.
217+ automatically by compliant software libraries.
218218 * It reduces chances for misconfigurations, for example misconfigured endpoint
219219 URLs (that might belong to an attacker) or misconfigured security features.
220220 * It can help to facilitate rotation of cryptographic keys and to ensure
0 commit comments