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

@PermitAll and @Secured(SecurityRule.IS_ANONYMOUS) not working on methods with any sort of parameter (body, header or query) #1926

Open
nbrugger-tgm opened this issue Feb 5, 2025 · 0 comments

Comments

@nbrugger-tgm
Copy link

nbrugger-tgm commented Feb 5, 2025

Expected Behavior

When adding @Secured(SecurityRule.IS_ANONYMOUS) and/or @PermitAll to a HTTP handler method (@Post ....) it should allow unchecked and anonymous access to said method, even when passing parameters such as a body!

Actual Behaviour

Requests to endpoints with query parameters, headers or Body are turned down as HttpClientResponseException: Unauthorized (or whichever http client you use)

I have a MVCE; https://github.com/nbrugger-tgm/micronaut-reproductions/tree/main/permit-all-body-issue

Steps To Reproduce

  1. clone https://github.com/nbrugger-tgm/micronaut-reproductions to your local machine
  2. cd micronaut-reproductions/permit-all-body-issue
  3. ./gradle test

Environment Information

  • Operating System: Linux
  • Micronaut Version: 4.x (tested like 12 versions including latest)

Example Application

https://github.com/nbrugger-tgm/micronaut-reproductions/tree/main/permit-all-body-issue

Version

4.x.x

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

1 participant