Skip to content

Add application-scoped access tokens for reactive OAuth2 client#18774

Open
jyx-07 wants to merge 1 commit intospring-projects:mainfrom
jyx-07:docs/reactive-oauth2-access-token
Open

Add application-scoped access tokens for reactive OAuth2 client#18774
jyx-07 wants to merge 1 commit intospring-projects:mainfrom
jyx-07:docs/reactive-oauth2-access-token

Conversation

@jyx-07
Copy link

@jyx-07 jyx-07 commented Feb 22, 2026

Closes #17129

Problem

The Spring Security documentation explains how to use application-scoped
access tokens (Client Credentials grant) for servlet applications, but
there was no equivalent documentation for reactive applications.

Solution

Add a new section to the reactive OAuth2 client authorization-grants
documentation that shows how to configure WebClient with
AuthorizedClientServiceReactiveOAuth2AuthorizedClientManager for
application-scoped (non-user-scoped) access tokens.

Changes

  • docs: Add new section "Use the Client Credentials Grant for
    Application-Scoped Access Tokens" to authorization-grants.adoc
  • test: Add ApplicationScopedAccessTokenConfiguration.java
  • test: Add ApplicationScopedAccessTokenTests.java

…2 client

Signed-off-by: C0ng_yun <s25069@gsm.hs.kr>
@jyx-07 jyx-07 force-pushed the docs/reactive-oauth2-access-token branch from ea08448 to d59ab13 Compare February 22, 2026 09:55
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Feb 22, 2026
@thladsb
Copy link

thladsb commented Mar 3, 2026

I believe ServerOAuth2AuthorizedClientExchangeFilterFunction is not application-scoped, as mentioned in issue #17218.

@jyx-07
Copy link
Author

jyx-07 commented Mar 13, 2026

Thanks for pointing this out.

In this example, the WebClient is configured with
AuthorizedClientServiceReactiveOAuth2AuthorizedClientManager
and a clientCredentials() provider, which means the access token
is obtained using the Client Credentials grant.

Since this grant type does not involve a user, the token is
application-scoped.

ServerOAuth2AuthorizedClientExchangeFilterFunction is used here
only as a WebClient filter that delegates authorization to the
configured ReactiveOAuth2AuthorizedClientManager.

@FryingHellfish
Copy link

I agree with @thladsb. I was hoping for an example similar to Use the Client Credentials Grant, specifically the part demonstrating OAuth2ClientHttpRequestInterceptor and RequestAttributePrincipalResolver.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: waiting-for-triage An issue we've not yet triaged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Document Application-Scoped Access Tokens for Reactive OAuth2 Client Applications

4 participants