Browse Source

Update terminology to HTTP Service Clients

Closes gh-17947
pull/17949/head
Rob Winch 3 months ago
parent
commit
4ef16b14d2
No known key found for this signature in database
  1. 2
      docs/modules/ROOT/nav.adoc
  2. 28
      docs/modules/ROOT/pages/features/integrations/rest/http-service-client.adoc
  3. 4
      docs/modules/ROOT/pages/servlet/oauth2/client/authorized-clients.adoc
  4. 4
      docs/modules/ROOT/pages/whats-new.adoc
  5. 2
      docs/src/test/java/org/springframework/security/docs/features/integrations/rest/clientregistrationid/UserService.java
  6. 2
      docs/src/test/kotlin/org/springframework/security/kt/docs/features/integrations/rest/clientregistrationid/UserService.kt

2
docs/modules/ROOT/nav.adoc

@ -21,7 +21,7 @@
*** xref:features/exploits/http.adoc[HTTP Requests] *** xref:features/exploits/http.adoc[HTTP Requests]
** xref:features/integrations/index.adoc[Integrations] ** xref:features/integrations/index.adoc[Integrations]
*** REST Client *** REST Client
**** xref:features/integrations/rest/http-interface.adoc[HTTP Interface Integration] **** xref:features/integrations/rest/http-service-client.adoc[HTTP Service Clients]
*** xref:features/integrations/cryptography.adoc[Cryptography] *** xref:features/integrations/cryptography.adoc[Cryptography]
*** xref:features/integrations/data.adoc[Spring Data] *** xref:features/integrations/data.adoc[Spring Data]
*** xref:features/integrations/concurrency.adoc[Java's Concurrency APIs] *** xref:features/integrations/concurrency.adoc[Java's Concurrency APIs]

28
docs/modules/ROOT/pages/features/integrations/rest/http-interface.adoc → docs/modules/ROOT/pages/features/integrations/rest/http-service-client.adoc

@ -1,55 +1,55 @@
= HTTP Interface Integration = HTTP Service Clients Integration
Spring Security's OAuth Support can integrate with `RestClient` and `WebClient` {spring-framework-reference-url}/integration/rest-clients.html[HTTP Interface based REST Clients]. Spring Security's OAuth Support can integrate with `RestClient` and `WebClient` {spring-framework-reference-url}integration/rest-clients.html#rest-http-service-client[HTTP Service Clients].
[[configuration]] [[configuration]]
== Configuration == Configuration
After xref:features/integrations/rest/http-interface.adoc#configuration-restclient[RestClient] or xref:features/integrations/rest/http-interface.adoc#configuration-webclient[WebClient] specific configuration, usage of xref:features/integrations/rest/http-interface.adoc[] only requires adding a xref:features/integrations/rest/http-interface.adoc#client-registration-id[`@ClientRegistrationId`] to methods that require OAuth or their declaring HTTP interface. After xref:features/integrations/rest/http-service-client.adoc#configuration-restclient[RestClient] or xref:features/integrations/rest/http-service-client.adoc#configuration-webclient[WebClient] specific configuration, usage of xref:features/integrations/rest/http-service-client.adoc[] only requires adding a xref:features/integrations/rest/http-service-client.adoc#client-registration-id[`@ClientRegistrationId`] to methods that require OAuth or their declaring HTTP interface.
Since the presence of xref:features/integrations/rest/http-interface.adoc#client-registration-id[`@ClientRegistrationId`] determines if and how the OAuth token will be resolved, it is safe to add Spring Security's OAuth support any configuration. Since the presence of xref:features/integrations/rest/http-service-client.adoc#client-registration-id[`@ClientRegistrationId`] determines if and how the OAuth token will be resolved, it is safe to add Spring Security's OAuth support any configuration.
[[configuration-restclient]] [[configuration-restclient]]
=== RestClient Configuration === RestClient Configuration
Spring Security's OAuth Support can integrate with {spring-framework-reference-url}/integration/rest-clients.html[HTTP Interface based REST Clients] backed by RestClient. Spring Security's OAuth Support can integrate with {spring-framework-reference-url}integration/rest-clients.html#rest-http-service-client[HTTP Service Clients] backed by `RestClient`.
The first step is to xref:servlet/oauth2/client/core.adoc#oauth2Client-authorized-manager-provider[create an `OAuthAuthorizedClientManager` Bean]. The first step is to xref:servlet/oauth2/client/core.adoc#oauth2Client-authorized-manager-provider[create an `OAuthAuthorizedClientManager` Bean].
Next you must configure `HttpServiceProxyFactory` and `RestClient` to be aware of xref:./http-interface.adoc#client-registration-id[@ClientRegistrationId] Next you must configure `HttpServiceProxyFactory` and `RestClient` to be aware of xref:./http-service-client.adoc#client-registration-id[@ClientRegistrationId]
To simplify this configuration, use javadoc:org.springframework.security.oauth2.client.web.client.support.OAuth2RestClientHttpServiceGroupConfigurer[]. To simplify this configuration, use javadoc:org.springframework.security.oauth2.client.web.client.support.OAuth2RestClientHttpServiceGroupConfigurer[].
include-code::./RestClientHttpInterfaceIntegrationConfiguration[tag=config,indent=0] include-code::./RestClientHttpInterfaceIntegrationConfiguration[tag=config,indent=0]
The configuration: The configuration:
- Adds xref:features/integrations/rest/http-interface.adoc#client-registration-id-processor[`ClientRegistrationIdProcessor`] to {spring-framework-reference-url}/integration/rest-clients.html#rest-http-interface[`HttpServiceProxyFactory`] - Adds xref:features/integrations/rest/http-service-client.adoc#client-registration-id-processor[`ClientRegistrationIdProcessor`] to {spring-framework-reference-url}integration/rest-clients.html#rest-http-service-client[`HttpServiceProxyFactory`]
- Adds xref:servlet/oauth2/client/authorized-clients.adoc#oauth2-client-rest-client[`OAuth2ClientHttpRequestInterceptor`] to the `RestClient` - Adds xref:servlet/oauth2/client/authorized-clients.adoc#oauth2-client-rest-client[`OAuth2ClientHttpRequestInterceptor`] to the `RestClient`
[[configuration-webclient]] [[configuration-webclient]]
=== WebClient Configuration === WebClient Configuration
Spring Security's OAuth Support can integrate with {spring-framework-reference-url}/integration/rest-clients.html[HTTP Interface based REST Clients] backed by `WebClient`. Spring Security's OAuth Support can integrate with {spring-framework-reference-url}integration/rest-clients.html#rest-http-service-client[HTTP Service Clients] backed by `WebClient`.
The first step is to xref:reactive/oauth2/client/core.adoc#oauth2Client-authorized-manager-provider[create an `ReactiveOAuthAuthorizedClientManager` Bean]. The first step is to xref:reactive/oauth2/client/core.adoc#oauth2Client-authorized-manager-provider[create an `ReactiveOAuthAuthorizedClientManager` Bean].
Next you must configure `HttpServiceProxyFactory` and `WebRestClient` to be aware of xref:./http-interface.adoc#client-registration-id[@ClientRegistrationId] Next you must configure `HttpServiceProxyFactory` and `WebRestClient` to be aware of xref:./http-service-client.adoc#client-registration-id[@ClientRegistrationId]
To simplify this configuration, use javadoc:org.springframework.security.oauth2.client.web.reactive.function.client.support.OAuth2WebClientHttpServiceGroupConfigurer[]. To simplify this configuration, use javadoc:org.springframework.security.oauth2.client.web.reactive.function.client.support.OAuth2WebClientHttpServiceGroupConfigurer[].
include-code::./ServerWebClientHttpInterfaceIntegrationConfiguration[tag=config,indent=0] include-code::./ServerWebClientHttpInterfaceIntegrationConfiguration[tag=config,indent=0]
The configuration: The configuration:
- Adds xref:features/integrations/rest/http-interface.adoc#client-registration-id-processor[`ClientRegistrationIdProcessor`] to {spring-framework-reference-url}/integration/rest-clients.html#rest-http-interface[`HttpServiceProxyFactory`] - Adds xref:features/integrations/rest/http-service-client.adoc#client-registration-id-processor[`ClientRegistrationIdProcessor`] to {spring-framework-reference-url}/integration/rest-clients.html#rest-http-service-client[`HttpServiceProxyFactory`]
- Adds xref:reactive/oauth2/client/authorized-clients.adoc#oauth2-client-web-client[`ServerOAuth2AuthorizedClientExchangeFilterFunction`] to the `WebClient` - Adds xref:reactive/oauth2/client/authorized-clients.adoc#oauth2-client-web-client[`ServerOAuth2AuthorizedClientExchangeFilterFunction`] to the `WebClient`
[[client-registration-id]] [[client-registration-id]]
== @ClientRegistrationId == @ClientRegistrationId
You can add the javadoc:org.springframework.security.oauth2.client.annotation.ClientRegistrationId[] on the HTTP Interface to specify which javadoc:org.springframework.security.oauth2.client.registration.ClientRegistration[] to use. You can add the javadoc:org.springframework.security.oauth2.client.annotation.ClientRegistrationId[] on the HTTP Service to specify which javadoc:org.springframework.security.oauth2.client.registration.ClientRegistration[] to use.
include-code::./UserService[tag=getAuthenticatedUser] include-code::./UserService[tag=getAuthenticatedUser]
The xref:features/integrations/rest/http-interface.adoc#client-registration-id[`@ClientRegistrationId`] will be processed by xref:features/integrations/rest/http-interface.adoc#client-registration-id-processor[`ClientRegistrationIdProcessor`] The xref:features/integrations/rest/http-service-client.adoc#client-registration-id[`@ClientRegistrationId`] will be processed by xref:features/integrations/rest/http-service-client.adoc#client-registration-id-processor[`ClientRegistrationIdProcessor`]
[[type]] [[type]]
=== Type Level Declarations === Type Level Declarations
@ -61,9 +61,9 @@ include-code::./UserService[tag=type]
[[client-registration-id-processor]] [[client-registration-id-processor]]
== `ClientRegistrationIdProcessor` == `ClientRegistrationIdProcessor`
The xref:features/integrations/rest/http-interface.adoc#configuration[configured] javadoc:org.springframework.security.oauth2.client.web.client.ClientRegistrationIdProcessor[] will: The xref:features/integrations/rest/http-service-client.adoc#configuration[configured] javadoc:org.springframework.security.oauth2.client.web.client.ClientRegistrationIdProcessor[] will:
- Automatically invoke javadoc:org.springframework.security.oauth2.client.web.ClientAttributes#clientRegistrationId(java.lang.String)[] for each xref:features/integrations/rest/http-interface.adoc#client-registration-id[`@ClientRegistrationId`]. - Automatically invoke javadoc:org.springframework.security.oauth2.client.web.ClientAttributes#clientRegistrationId(java.lang.String)[] for each xref:features/integrations/rest/http-service-client.adoc#client-registration-id[`@ClientRegistrationId`].
- This adds the javadoc:org.springframework.security.oauth2.client.registration.ClientRegistration#getId()[] to the attributes - This adds the javadoc:org.springframework.security.oauth2.client.registration.ClientRegistration#getId()[] to the attributes
The `id` is then processed by: The `id` is then processed by:

4
docs/modules/ROOT/pages/servlet/oauth2/client/authorized-clients.adoc

@ -495,9 +495,9 @@ class RestClientConfig {
===== =====
[[oauth2-client-rest-client-interface]] [[oauth2-client-rest-client-interface]]
=== HTTP Interface Integration === HTTP Service Clients
Spring Security's OAuth support integrates with xref:features/integrations/rest/http-interface.adoc[]. Spring Security's OAuth support integrates with xref:features/integrations/rest/http-service-client.adoc[].
[[oauth2-client-web-client]] [[oauth2-client-web-client]]
== [[oauth2Client-webclient-servlet]]WebClient Integration for Servlet Environments == [[oauth2Client-webclient-servlet]]WebClient Integration for Servlet Environments

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

@ -56,10 +56,10 @@ http.csrf((csrf) -> csrf.spa());
== OAuth 2.0 == OAuth 2.0
* Removed support for password grant * Removed support for password grant
* Added OAuth2 Support for xref:features/integrations/rest/http-interface.adoc[HTTP Interface Integration] * Added OAuth2 Support for xref:features/integrations/rest/http-service-client.adoc[HTTP Service Clients]
* Added support for custom `JwkSource` in `NimbusJwtDecoder`, allowing usage of Nimbus's `JwkSourceBuilder` API * Added support for custom `JwkSource` in `NimbusJwtDecoder`, allowing usage of Nimbus's `JwkSourceBuilder` API
* Added builder for `NimbusJwtEncoder`, supports specifying an EC or RSA key pair or a secret key * Added builder for `NimbusJwtEncoder`, supports specifying an EC or RSA key pair or a secret key
* Added support for `@ClientRegistrationId` at the xref:features/integrations/rest/http-interface.adoc#type[type level], eliminating the need for method level repetition * Added support for `@ClientRegistrationId` at the xref:features/integrations/rest/http-service-client.adoc#type[type level], eliminating the need for method level repetition
== SAML 2.0 == SAML 2.0

2
docs/src/test/java/org/springframework/security/docs/features/integrations/rest/clientregistrationid/UserService.java

@ -21,7 +21,7 @@ import org.springframework.web.service.annotation.GetExchange;
import org.springframework.web.service.annotation.HttpExchange; import org.springframework.web.service.annotation.HttpExchange;
/** /**
* Demonstrates a service for {@link ClientRegistrationId} and HTTP Interface clients. * Demonstrates a service for {@link ClientRegistrationId} and HTTP Service clients.
* @author Rob Winch * @author Rob Winch
*/ */
@HttpExchange @HttpExchange

2
docs/src/test/kotlin/org/springframework/security/kt/docs/features/integrations/rest/clientregistrationid/UserService.kt

@ -21,7 +21,7 @@ import org.springframework.web.service.annotation.GetExchange
import org.springframework.web.service.annotation.HttpExchange import org.springframework.web.service.annotation.HttpExchange
/** /**
* Demonstrates a service for {@link ClientRegistrationId} and HTTP Interface clients. * Demonstrates a service for {@link ClientRegistrationId} and HTTP Service Clients.
* @author Rob Winch * @author Rob Winch
*/ */
@HttpExchange @HttpExchange

Loading…
Cancel
Save