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 Webflex - reactor core exception - accessing endpoint with http: basic auth #15348

Open
dreamstar-enterprises opened this issue Jul 2, 2024 · 2 comments
Labels
in: web An issue in web modules (web, webmvc) status: feedback-provided Feedback has been provided

Comments

@dreamstar-enterprises
Copy link

dreamstar-enterprises commented Jul 2, 2024

I'm sure this shouldn't happen, but when I try to access an endpoint requiring basic http authentication, from postman, but in postman set authetication to none, instead of getting not authenticated / not authorized back, Spring Boot throws an exception and crashes,

2024-07-02T21:54:33.799+01:00 WARN 79450 --- [ parallel-1] reactor.core.Exceptions : throwIfFatal detected a jvm fatal exception, which is thrown and logged below:

java.lang.StackOverflowError: null
	at reactor.core.publisher.InnerOperator.currentContext(InnerOperator.java:33) ~[reactor-core-3.5.11.jar:3.5.11]
	at reactor.core.publisher.MonoFlatMap$FlatMapInner.currentContext(MonoFlatMap.java:270) ~[reactor-core-3.5.11.jar:3.5.11]
	at reactor.core.publisher.InnerOperator.currentContext(InnerOperator.java:33) ~[reactor-core-3.5.11.jar:3.5.11]
	at reactor.core.publisher.InnerOperator.currentContext(InnerOperator.java:33) ~[reactor-core-3.5.11.jar:3.5.11]
	at reactor.core.publisher.InnerOperator.currentContext(InnerOperator.java:33) ~[reactor-core-3.5.11.jar:3.5.11]
	at reactor.core.publisher.InnerOperator.currentContext(InnerOperator.java:33) ~[reactor-core-3.5.11.jar:3.5.11]
	at reactor.core.publisher.InnerOperator.currentContext(InnerOperator.java:33) ~[reactor-core-3.5.11.jar:3.5.11

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior.

Expected behavior
A clear and concise description of what you expected to happen.

Sample

A link to a GitHub repository with a minimal, reproducible sample.

Reports that include a sample will take priority over reports that do not.
At times, we may require a sample, so it is good to try and include a sample up front.

@dreamstar-enterprises dreamstar-enterprises added status: waiting-for-triage An issue we've not yet triaged type: bug A general bug labels Jul 2, 2024
@jzheaux
Copy link
Contributor

jzheaux commented Jul 18, 2024

Thanks, @dreamstar-enterprises, will you please share a minimal reproducer to help get to the bottom of the issue faster?

@jzheaux jzheaux added status: waiting-for-feedback We need additional information before we can continue in: web An issue in web modules (web, webmvc) and removed status: waiting-for-triage An issue we've not yet triaged type: bug A general bug labels Jul 18, 2024
@dreamstar-enterprises
Copy link
Author

I have a 6 week code base to try and do this (I only have half a auth server working, and the resource server sort of works)

I've since been able to get past the above problem I can't though get the auth server url redirection to work without using HttpSessionSecurityContextRepository

It did not work on Null or RequestAttribute version - as on the re-direct, it just couldn't find the authenticated principal.

I don't know if it is best practice, but I ended up setting the session time to 5 seconds.

I do wish there was just ONE comprehensive guide that explained how to connect (even if it was not a 20min read, but a 90 min read...):

  1. Angular (User Agent)
  2. Spring Client Auth (BFF)
  3. Spring Auth Server (Stateless if possible, using Opaque Tokens)
  4. Spring Resource Server (Rest Statless, but with a caching strategy of the Authentication Objects, so the introspection endpoint isn't queried on every request)

And how to host the Spring Servers, where and how to use Spring Gateway or Spring Session / Redis

I've spent 6 weeks on this, but really do feel I haven't go very far : (

Thanks for the help so far though. Do you do consultancy work? I have a small budget.

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels Jul 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web An issue in web modules (web, webmvc) status: feedback-provided Feedback has been provided
Projects
None yet
Development

No branches or pull requests

3 participants