Skip to content

Commit 0bde3c5

Browse files
committed
Clarify ServerBearerExchangeFilterFunction Docs
Fixes gh-8220
1 parent 4e8c177 commit 0bde3c5

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

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

+8-3
Original file line numberDiff line numberDiff line change
@@ -1926,7 +1926,7 @@ http
19261926

19271927
=== Bearer Token Propagation
19281928

1929-
Now that you're in possession of a bearer token, it might be handy to pass that to downstream services.
1929+
Now that you're resource server has validated the token, it might be handy to pass it to downstream services.
19301930
This is quite simple with `{security-api-url}org/springframework/security/oauth2/server/resource/web/reactive/function/client/ServletBearerExchangeFilterFunction.html[ServletBearerExchangeFilterFunction]`, which you can see in the following example:
19311931

19321932
[source,java]
@@ -1970,12 +1970,12 @@ this.rest.get()
19701970
In this case, the filter will fall back and simply forward the request onto the rest of the web filter chain.
19711971

19721972
[NOTE]
1973-
Unlike the https://docs.spring.io/spring-security/site/docs/current-SNAPSHOT/api/org/springframework/security/oauth2/client/web/reactive/function/client/ServletOAuth2AuthorizedClientExchangeFilterFunction.html[OAuth 2.0 Client filter function], this filter function makes no attempt to renew the token, should it be expired.
1973+
Unlike the {security-api-url}org/springframework/security/oauth2/client/web/reactive/function/client/ServletOAuth2AuthorizedClientExchangeFilterFunction.html[OAuth 2.0 Client filter function], this filter function makes no attempt to renew the token, should it be expired.
19741974
To obtain this level of support, please use the OAuth 2.0 Client filter.
19751975

19761976
==== `RestTemplate` support
19771977

1978-
There is no dedicated support for `RestTemplate` at the moment, but you can achieve propagation quite simply with your own interceptor:
1978+
There is no `RestTemplate` equivalent for `ServletBearerExchangeFilterFunction` at the moment, but you can propagate the request's bearer token quite simply with your own interceptor:
19791979

19801980
[source,java]
19811981
----
@@ -2000,6 +2000,11 @@ RestTemplate rest() {
20002000
}
20012001
----
20022002

2003+
2004+
[NOTE]
2005+
Unlike the {security-api-url}org/springframework/security/oauth2/client/OAuth2AuthorizedClientManager.html[OAuth 2.0 Authorized Client Manager], this filter interceptor makes no attempt to renew the token, should it be expired.
2006+
To obtain this level of support, please create an interceptor using the <<oauth2client,OAuth 2.0 Authorized Client Manager>>.
2007+
20032008
[[oauth2resourceserver-bearertoken-failure]]
20042009
=== Bearer Token Failure
20052010

0 commit comments

Comments
 (0)