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

Using custom implementation for auth token ,How to leverage security context holder to get authentication if token is not changed for subsequent request #388

Open
Dinesh123 opened this issue Nov 22, 2023 · 1 comment

Comments

@Dinesh123
Copy link

I am using custom implementation for authentication as mentioned in your document.
Using authsceheme selector and provider , I don't want to authenticate for every request instead i want to leverage
Context to get current authentication object and check if token has not changed.

I am not sure how authentication object is saved in SecurityContextHolder, i do see it gets cleared with every request.
overall i don't understand intention behind saving authentication object in security context holder if its not used for subsequent request.

I am using unary call's

@jvmlet
Copy link
Collaborator

jvmlet commented Nov 22, 2023

The intention of saving it in context is to enable the service call implementation to obtain the details of the user currently executing the request.
What you are looking for is the http-session-scope alternative for grpc call. This doesn't exist. IFIAK.
But, http session is a simply caching mechanism you can implement by your self to hold token->Authentication map to gain performance by caching the authentication result .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants