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 Webflux - cannot get PreAuthortize to work (using Kotlin) #15347

Closed
dreamstar-enterprises opened this issue Jul 2, 2024 · 5 comments
Closed
Assignees
Labels
for: stackoverflow A question that's better suited to stackoverflow.com in: cas An issue in spring-security-cas

Comments

@dreamstar-enterprises
Copy link

Please see here >>

https://stackoverflow.com/questions/78698990/spring-webflux-preauthorize-not-working-work-using-kotlin

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
@dreamstar-enterprises
Copy link
Author

Seems like this is still an issue:
#12080

@dreamstar-enterprises
Copy link
Author

I've tested this multiple times, and still cannot get this to work..

https://stackoverflow.com/questions/78698990/spring-webflux-spring-security-preauthorize-not-working-work-using-kotlin

@dreamstar-enterprises
Copy link
Author

The one case where it does work is if I put pre-authorize on the controller, but it all other cases, it doesn't work.

@jzheaux jzheaux self-assigned this Jul 18, 2024
@jzheaux jzheaux added in: cas An issue in spring-security-cas for: stackoverflow A question that's better suited to stackoverflow.com and removed status: waiting-for-triage An issue we've not yet triaged type: bug A general bug labels Jul 18, 2024
@jzheaux
Copy link
Contributor

jzheaux commented Jul 18, 2024

Thanks for the StackOverflow link, @dreamstar-enterprises. It looks like you got some support from the community; since there is no accepted answer yet, I will periodically check the question for any additional developments.

@jzheaux jzheaux closed this as completed Jul 18, 2024
@dreamstar-enterprises
Copy link
Author

Thank you.

For the above no matter what I did, I couldn't get it to work with co-routines, so I ended up creating a layer between the Server, and Controller, that converted the suspend functions into a Mono, and then changing all functions in my Controllers to a Mono : (

I do wish there was just ONE comprehensive guide that explained how to connect:

  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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
for: stackoverflow A question that's better suited to stackoverflow.com in: cas An issue in spring-security-cas
Projects
None yet
Development

No branches or pull requests

2 participants