Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reactive Security OAuth2 client doesn't propagate traces and baggage's in Spring Boot 3 #14946

Open
DaceKonn opened this issue Apr 23, 2024 · 1 comment
Assignees
Labels
in: oauth2 An issue in OAuth2 modules (oauth2-core, oauth2-client, oauth2-resource-server, oauth2-jose) status: waiting-for-feedback We need additional information before we can continue type: bug A general bug

Comments

@DaceKonn
Copy link

Describe the bug
The current version of Reactive OAuth Security doesn't follow all Observability documentation recommendations, therefore it doesn't propagate trace and baggage's over network. See: Docs Spring.io - 8.4. Propagating Traces

Class example:
oauth2/oauth2-client/src/main/java/org/springframework/security/oauth2/client/endpoint/AbstractWebClientReactiveOAuth2AccessTokenResponseClient.java

Where WebClient.Builder() is used statically - therefore it has NOOP ObservationRegistry and doesn't register Request Observations, and doesn't allow propagating traces (for example B3 Brave Zipkin Baggage's propagation).

To Reproduce
Creating Reactive OAuth client and trying to send traces and baggage's to authentication server.

Expected behavior
OAuth calls from client to server in Reactive Security and Spring Boot 3 start proper request observations and propagate baggage's.

@DaceKonn DaceKonn added status: waiting-for-triage An issue we've not yet triaged type: bug A general bug labels Apr 23, 2024
@sjohnr sjohnr self-assigned this May 9, 2024
@sjohnr
Copy link
Member

sjohnr commented May 9, 2024

Thanks for the report @DaceKonn! I'm not sure I agree with classifying this as a bug, and instead feel this might make a good enhancement request. I don't find anywhere in the docs that we state the OAuth2 Client features support downstream propagation. Do you find anything like that?

Note that you will easily be able to configure a custom WebClient for any OAuth2 Client component in 6.3 (soon to be released) by following Customize the WebClient used by OAuth2 Client Components in the reference (this link currently points to RC1 docs). That section of the docs also includes a more verbose example that works prior to 6.3.

@sjohnr sjohnr added status: waiting-for-feedback We need additional information before we can continue in: oauth2 An issue in OAuth2 modules (oauth2-core, oauth2-client, oauth2-resource-server, oauth2-jose) and removed status: waiting-for-triage An issue we've not yet triaged labels May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: oauth2 An issue in OAuth2 modules (oauth2-core, oauth2-client, oauth2-resource-server, oauth2-jose) status: waiting-for-feedback We need additional information before we can continue type: bug A general bug
Projects
None yet
Development

No branches or pull requests

2 participants