Update reactive OAuth2 docs

Issue gh-15938
This commit is contained in:
Steve Riesenberg
2024-10-28 12:29:11 -05:00
parent 9d2ca3da6a
commit d5cb41156c
6 changed files with 499 additions and 215 deletions

View File

@@ -1,9 +1,10 @@
[[oauth2Client-client-auth-support]]
= Client Authentication Support
[[oauth2-client-authentication]]
= [[oauth2Client-client-auth-support]]Client Authentication Support
[[oauth2Client-client-credentials-auth]]
== Client Credentials
[[oauth2-client-authentication-client-credentials]]
== [[oauth2Client-client-credentials-auth]]Client Credentials
[[oauth2-client-authentication-client-credentials-client-secret-basic]]
=== Authenticate using `client_secret_basic`
Client Authentication with HTTP Basic is supported out of the box and no customization is necessary to enable it.
@@ -55,6 +56,7 @@ tokenResponseClient.setHeadersConverter(headersConverter)
----
======
[[oauth2-client-authentication-client-credentials-client-secret-post]]
=== Authenticate using `client_secret_post`
Client Authentication with client credentials included in the request-body is supported out of the box and no customization is necessary to enable it.
@@ -76,8 +78,8 @@ spring:
...
----
[[oauth2Client-jwt-bearer-auth]]
== JWT Bearer
[[oauth2-client-authentication-jwt-bearer]]
== [[oauth2Client-jwt-bearer-auth]]JWT Bearer
[NOTE]
Please refer to JSON Web Token (JWT) Profile for OAuth 2.0 Client Authentication and Authorization Grants for further details on https://datatracker.ietf.org/doc/html/rfc7523#section-2.2[JWT Bearer] Client Authentication.
@@ -89,7 +91,7 @@ a signed JSON Web Token (JWS) in the `client_assertion` parameter.
The `java.security.PrivateKey` or `javax.crypto.SecretKey` used for signing the JWS
is supplied by the `com.nimbusds.jose.jwk.JWK` resolver associated with `NimbusJwtClientAuthenticationParametersConverter`.
[[oauth2-client-authentication-jwt-bearer-private-key-jwt]]
=== Authenticate using `private_key_jwt`
Given the following Spring Boot properties for an OAuth 2.0 Client registration:
@@ -160,7 +162,7 @@ tokenResponseClient.addParametersConverter(
----
======
[[oauth2-client-authentication-jwt-bearer-client-secret-jwt]]
=== Authenticate using `client_secret_jwt`
Given the following Spring Boot properties for an OAuth 2.0 Client registration:
@@ -230,6 +232,7 @@ tokenResponseClient.addParametersConverter(
----
======
[[oauth2-client-authentication-jwt-bearer-assertion]]
=== Customizing the JWT assertion
The JWT produced by `NimbusJwtClientAuthenticationParametersConverter` contains the `iss`, `sub`, `aud`, `jti`, `iat` and `exp` claims by default. You can customize the headers and/or claims by providing a `Consumer<NimbusJwtClientAuthenticationParametersConverter.JwtClientAuthenticationContext<T>>` to `setJwtClientAssertionCustomizer()`. The following example shows how to customize claims of the JWT:
@@ -265,8 +268,8 @@ converter.setJwtClientAssertionCustomizer { context ->
----
======
[[oauth2Client-public-auth]]
== Public Authentication
[[oauth2-client-authentication-public]]
== [[oauth2Client-public-auth]]Public Authentication
Public Client Authentication is supported out of the box and no customization is necessary to enable it.