Quarkus endpoint does not require Authorization header #23305
-
I want my endpoint to require a valid JWT token to be accessed. The token must be signed using JWK that is in a remote location. I set the following config to application.yml:
Heres is my endpoint:
When sending the Authorization header with a Bearer token, it checks whether the token is valid or not as expected, but when a request is sent without an Authorization header the endpoint can be accessed. Desired Behaviour When a request without Authorization header is sent, the endpoint returns an HTTP 401 Any help? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
@rafareyes7 Please add |
Beta Was this translation helpful? Give feedback.
@rafareyes7 Please add
@io.quarkus.security.Authenticated
to the endpoint class