Skip to content

Commit 7dc3c8a

Browse files
sdoxseejgrandja
authored andcommitted
Add documentation for Public Client PKCE support
Fixes gh-7279
1 parent d3b7a47 commit 7dc3c8a

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

docs/manual/src/docs/asciidoc/_includes/servlet/oauth2/oauth2-client.adoc

+23
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,29 @@ A request with the base path `/oauth2/authorization/okta` will initiate the Auth
407407
The `AuthorizationCodeOAuth2AuthorizedClientProvider` is an implementation of `OAuth2AuthorizedClientProvider` for the Authorization Code grant,
408408
which also initiates the Authorization Request redirect by the `OAuth2AuthorizationRequestRedirectFilter`.
409409

410+
If the OAuth 2.0 Client is a https://tools.ietf.org/html/rfc6749#section-2.1[Public Client], than configure the OAuth 2.0 Client registration as follows:
411+
412+
[source,yaml]
413+
----
414+
spring:
415+
security:
416+
oauth2:
417+
client:
418+
registration:
419+
okta:
420+
client-id: okta-client-id
421+
client-authentication-method: none
422+
authorization-grant-type: authorization_code
423+
redirect-uri: "{baseUrl}/authorized/okta"
424+
...
425+
----
426+
427+
Public Clients are supported using https://tools.ietf.org/html/rfc7636[Proof Key for Code Exchange] (PKCE).
428+
If the client is running in an untrusted environment (eg. native application or web browser-based application) and therefore incapable of maintaining the confidentiality of it's credentials, PKCE will automatically be used when the following conditions are true:
429+
430+
. `client-secret` is omitted (or empty)
431+
. `client-authentication-method` is set to "none" (`ClientAuthenticationMethod.NONE`)
432+
410433
The `DefaultOAuth2AuthorizationRequestResolver` also supports `URI` template variables for the `redirect-uri` using `UriComponentsBuilder`.
411434

412435
The following configuration uses all the supported `URI` template variables:

0 commit comments

Comments
 (0)