Skip to content

Commit 85d7cc1

Browse files
committed
Document requireProofKey
Issue gh-16386
1 parent 004f386 commit 85d7cc1

File tree

5 files changed

+24
-1
lines changed

5 files changed

+24
-1
lines changed

docs/modules/ROOT/pages/reactive/oauth2/client/authorization-grants.adoc

+4
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,10 @@ If the client is running in an untrusted environment (eg. native application or
7979
. `client-secret` is omitted (or empty)
8080
. `client-authentication-method` is set to "none" (`ClientAuthenticationMethod.NONE`)
8181

82+
or
83+
84+
. When `ClientRegistration.clientSettings.requireProofKey` is `true` (in this case `ClientRegistration.authorizationGrantType` must be `authorization_code`)
85+
8286
[TIP]
8387
====
8488
If the OAuth 2.0 Provider supports PKCE for https://tools.ietf.org/html/rfc6749#section-2.1[Confidential Clients], you may (optionally) configure it using `DefaultServerOAuth2AuthorizationRequestResolver.setAuthorizationRequestCustomizer(OAuth2AuthorizationRequestCustomizers.withPkce())`.

docs/modules/ROOT/pages/reactive/oauth2/client/core.adoc

+5
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ public final class ClientRegistration {
3939
4040
}
4141
}
42+
43+
public static final class ClientSettings {
44+
private boolean requireProofKey; // <17>
45+
}
4246
}
4347
----
4448
<1> `registrationId`: The ID that uniquely identifies the `ClientRegistration`.
@@ -64,6 +68,7 @@ The name may be used in certain scenarios, such as when displaying the name of t
6468
<15> `(userInfoEndpoint)authenticationMethod`: The authentication method used when sending the access token to the UserInfo Endpoint.
6569
The supported values are *header*, *form* and *query*.
6670
<16> `userNameAttributeName`: The name of the attribute returned in the UserInfo Response that references the Name or Identifier of the end-user.
71+
<17> [[oauth2Client-client-registration-requireProofKey]]`requireProofKey`: If `true` or if `authorizationGrantType` is `none`, then PKCE will be enabled by default.
6772

6873
A `ClientRegistration` can be initially configured using discovery of an OpenID Connect Provider's https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderConfig[Configuration endpoint] or an Authorization Server's https://tools.ietf.org/html/rfc8414#section-3[Metadata endpoint].
6974

docs/modules/ROOT/pages/servlet/oauth2/client/authorization-grants.adoc

+6-1
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,14 @@ spring:
7777
Public Clients are supported by using https://tools.ietf.org/html/rfc7636[Proof Key for Code Exchange] (PKCE).
7878
If the client is running in an untrusted environment (such as a native application or web browser-based application) and is therefore incapable of maintaining the confidentiality of its credentials, PKCE is automatically used when the following conditions are true:
7979

80-
. `client-secret` is omitted (or empty)
80+
. `client-secret` is omitted (or empty) and
8181
. `client-authentication-method` is set to `none` (`ClientAuthenticationMethod.NONE`)
8282

83+
or
84+
85+
. When `ClientRegistration.clientSettings.requireProofKey` is `true` (in this case `ClientRegistration.authorizationGrantType` must be `authorization_code`)
86+
87+
8388
[TIP]
8489
====
8590
If the OAuth 2.0 Provider supports PKCE for https://tools.ietf.org/html/rfc6749#section-2.1[Confidential Clients], you may (optionally) configure it using `DefaultOAuth2AuthorizationRequestResolver.setAuthorizationRequestCustomizer(OAuth2AuthorizationRequestCustomizers.withPkce())`.

docs/modules/ROOT/pages/servlet/oauth2/client/core.adoc

+5
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ public final class ClientRegistration {
4040
4141
}
4242
}
43+
44+
public static final class ClientSettings {
45+
private boolean requireProofKey; // <17>
46+
}
4347
}
4448
----
4549
<1> `registrationId`: The ID that uniquely identifies the `ClientRegistration`.
@@ -65,6 +69,7 @@ This information is available only if the Spring Boot property `spring.security.
6569
<15> `(userInfoEndpoint)authenticationMethod`: The authentication method used when sending the access token to the UserInfo Endpoint.
6670
The supported values are *header*, *form*, and *query*.
6771
<16> `userNameAttributeName`: The name of the attribute returned in the UserInfo Response that references the Name or Identifier of the end-user.
72+
<17> [[oauth2Client-client-registration-requireProofKey]]`requireProofKey`: If `true` or if `authorizationGrantType` is `none`, then PKCE will be enabled by default.
6873

6974
You can initially configure a `ClientRegistration` by using discovery of an OpenID Connect Provider's https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderConfig[Configuration endpoint] or an Authorization Server's https://tools.ietf.org/html/rfc8414#section-3[Metadata endpoint].
7075

docs/modules/ROOT/pages/whats-new.adoc

+4
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,7 @@ Below are the highlights of the release, or you can view https://github.com/spri
1010

1111
The `security.security.reached.filter.section` key name was corrected to `spring.security.reached.filter.section`.
1212
Note that this may affect reports that operate on this key name.
13+
14+
== OAuth
15+
16+
* https://github.com/spring-projects/spring-security/pull/16386[gh-16386] - Enable PKCE for confidential clients using `ClientRegistration.clientSettings.requireProofKey=true` for xref:servlet/oauth2/client/core.adoc#oauth2Client-client-registration-requireProofKey[servlet] and xref:reactive/oauth2/client/core.adoc#oauth2Client-client-registration-requireProofKey[reactive] applications

0 commit comments

Comments
 (0)