diff --git a/docs/manual/src/docs/asciidoc/_includes/servlet/additional-topics/webclient.adoc b/docs/manual/src/docs/asciidoc/_includes/servlet/additional-topics/webclient.adoc index f9b91d0a38..939b432b74 100644 --- a/docs/manual/src/docs/asciidoc/_includes/servlet/additional-topics/webclient.adoc +++ b/docs/manual/src/docs/asciidoc/_includes/servlet/additional-topics/webclient.adoc @@ -29,15 +29,15 @@ Spring Security builds on this support to provide additional benefits: == WebClient OAuth2 Setup The first step is ensuring to setup the `WebClient` correctly. -An example of setting up `WebClient` in a fully reactive environment can be found below: +An example of setting up `WebClient` in a servlet environment can be found below: [source,java] ---- @Bean -WebClient webClient(ReactiveClientRegistrationRepository clientRegistrations, - ServerOAuth2AuthorizedClientRepository authorizedClients) { - ServerOAuth2AuthorizedClientExchangeFilterFunction oauth = - new ServerOAuth2AuthorizedClientExchangeFilterFunction(clientRegistrations, authorizedClients); +WebClient webClient(ClientRegistrationRepository clientRegistrations, + OAuth2AuthorizedClientRepository authorizedClients) { + ServletOAuth2AuthorizedClientExchangeFilterFunction oauth = + new ServletOAuth2AuthorizedClientExchangeFilterFunction(clientRegistrations, authorizedClients); // (optional) explicitly opt into using the oauth2Login to provide an access token implicitly // oauth.setDefaultOAuth2AuthorizedClient(true); // (optional) set a default ClientRegistration.registrationId @@ -67,7 +67,7 @@ Mono body = this.webClient [[servlet-webclient-explicit]] == Explicit OAuth2AuthorizedClient -The `OAuth2AuthorizedClient` can be explicitly provided by setting it on the requests attributes. +The `OAuth2AuthorizedClient` can be explicitly provided by setting it on the request attributes. In the example below we resolve the `OAuth2AuthorizedClient` using Spring WebFlux or Spring MVC argument resolver support. However, it does not matter how the `OAuth2AuthorizedClient` is resolved.