-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Proactive auth as false doesn't work for endpoints annotated with @PermitAll and requests with Bearer Token #23749
Comments
/cc @sberyozkin |
@jrepe Thanks, as I said in our earlier discussion, I don't consider it a bug since |
@sberyozkin Ah alright then, if it's expected for @permitAll in the context of bearer tokens, than that's alright, and I'll take that into account. Feel free to close this then. |
@jrepe It is not specific to the bearer tokens, it should also fail for the basic auth case; as I said I was testing it locally and it was failing for me too (with
@stuartwdouglas I think we should be failing a request if the credential type is not recognized in case of @jrepe Can you please try |
I think this issue may be related, #17591 |
@jrepe That said, the current behavior in your reproducer makes sense; Try |
|
@stuartwdouglas @sberyozkin Amazing, thanks for the quick fix :) |
Fixes quarkusio#23749 (cherry picked from commit 7a3e8f3)
Describe the bug
I was moving a service we have from Quarkus version 2.3.1.Final to 2.7.1.Final and I've noticed there's different behaviour when it comes to proactive authentication and bearer tokens. From version 2.4.0 onwards, setting
quarkus.http.auth.proactive=false
doesn't seem to influence requests with bearer token authentication when the endpoint the request targets is annotated with @permitAll, returning 401 instead of 200, as was the case before 2.4.0. I've used Postman and curl for testing and additionally, the reproducer has tests that also produce different behaviour depending on the Quarkus version.This is the endpoint I'm testing
application properties:
Is this change in behaviour expected and does Quarkus treat the @permitAll annotation differently than it did in the versions prior to 2.4.0? I'm trying to understand the change in this behaviour, if it's expected or not, so I can modify our application code if needed.
Expected behavior
Request with Bearer Token authentication header to an endpoint with @permitAll annotation should succeed when proactive authentication is set to false, as was the case in version prior to 2.4.0.
Actual behavior
Request fails with 401.
How to Reproduce?
Reproducer:
https://github.com/jrepe/quarkus-proactive-reproducible
Steps to reproduce:
GreetingResource
inGreetingResource.java
, run tests again(All tests should pass)
Output of
uname -a
orver
Darwin Kernel Version 21.1.0: root:xnu-8019.41.5~1/RELEASE_X86_64 x86_64 i386 MacBookPro16,1 Darwin
Output of
java -version
openjdk version "11.0.8" 2020-07-14 OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.8+10) OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.8+10, mixed mode)
GraalVM version (if different from Java)
/
Quarkus version or git rev
2.7.1
Build tool (ie. output of
mvnw --version
orgradlew --version
)Gradle 7.3.3
Additional information
No response
The text was updated successfully, but these errors were encountered: