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

Spring security context added as additional http header to http request via service invocation #638

Closed
javageek79 opened this issue Oct 4, 2021 · 6 comments · Fixed by #642
Assignees
Labels
kind/bug Something isn't working P1
Milestone

Comments

@javageek79
Copy link

Expected Behavior

During service invocation, we are affected by #3408. This is mainly because the entire spring security context is added as a header to the request. In our case, this exceeds the default allowed header size for fasthttp requests.
As the service beeing called has no secured endpoint in this case, the security context is of no use during this workflow.
I would expect, that per default a tranfer of security context information via service invocation is disabled, an that it can be added, if needed.

Actual Behavior

service invocation in context of a spring security application breaks during runtime with a too large http header. see #3408

Steps to Reproduce the Problem

Have a spring security context containing many roles and scopes received e.g. by an oauth2 jwt token.

Release Note

RELEASE NOTE:

@javageek79 javageek79 added the kind/bug Something isn't working label Oct 4, 2021
@stefanJ-hub
Copy link

is there actually a reason why the spring security context is added as header to the service invocation?
(i do not see a reason here)

as @javageek79 mentioned - if this can not be "simply" dropped; would be good if we can at least toggle it off.

if you know some mediation approaches (that can be applied just now) - to have the security context NOT passed into the service invocation - we would be happy to hear ;-)

@artursouza
Copy link
Member

Is the Spring security context coming from the frontend calling into the backend and then Dapr sidecar? I would like to understand the flow.

@javageek79
Copy link
Author

Hi @artursouza, yes, the flow is as follows
"public" REST API -- spring security -> Service A -- dapr service invocation -> Service B

@artursouza artursouza self-assigned this Oct 5, 2021
@artursouza
Copy link
Member

I am working on an integration test to repro this. Thanks.

@artursouza
Copy link
Member

@javageek79 PR is merged, please try using the SDK version 1.4.0-SNAPSHOT

@stefanJ-hub
Copy link

@artursouza fix works for us. looking forward to a released SDK

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working P1
Projects
None yet
3 participants