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

Use micrometer context-propagation to propagate auth between threadlocal and reactor ops #13733

Open
ttddyy opened this issue Aug 22, 2023 · 1 comment
Labels
in: oauth2 An issue in OAuth2 modules (oauth2-core, oauth2-client, oauth2-resource-server, oauth2-jose) status: ideal-for-contribution An issue that we actively are looking for someone to help us with type: enhancement A general enhancement

Comments

@ttddyy
Copy link
Contributor

ttddyy commented Aug 22, 2023

In spring mvc with reactive API, it uses a custom reactor subscriber, SecurityReactorContextSubscriber, to propagate the authentication and servlet request and response to the reactor operation chain. (Defined in SecurityReactorContextConfiguration imported by OAuth2ImportSelector)

The micrometer context-propagation library provides support for propagating such objects between threadlocal and reactor operation chains.

It is nice to migrate to it which aligns how micrometer observations are propagated as well as avoiding reactor corner cases that may not able to propagate by Hooks.onLastOperator.

cc @sjohnr, @chemicL

relates to #11973

@ttddyy ttddyy added status: waiting-for-triage An issue we've not yet triaged type: enhancement A general enhancement labels Aug 22, 2023
@sjohnr sjohnr added in: oauth2 An issue in OAuth2 modules (oauth2-core, oauth2-client, oauth2-resource-server, oauth2-jose) status: ideal-for-contribution An issue that we actively are looking for someone to help us with and removed status: waiting-for-triage An issue we've not yet triaged labels Sep 20, 2023
@rstoyanchev
Copy link
Contributor

Currently we have a SecurityContextThreadLocalAccessor in Spring for GraphQL that I can see would be more generally applicable. Not sure if that belongs in this issue or another.

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: ideal-for-contribution An issue that we actively are looking for someone to help us with type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

3 participants