-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
NPE in Quarkus Rest Client when receiving 401 with OIDC Token Propagation #35730
Comments
/cc @cescoffier (rest-client), @geoand (rest-client), @pedroigor (oidc), @sberyozkin (oidc) |
Hm... this looks weird and could be more complex than simply guarding against a Would you be able to provide a sample that behaves as you describe? |
Hey, I'm checking the tests right now as well |
I will however open a PR guarding against the NPE, as there is nothing in the Javadoc saying that the value has to be non-null |
We have a few tests in the main repository but also in the quickstart, which first this case precisely, but the negative test for the token propagation was missing, so I added it: quarkusio/quarkus-quickstarts#1323 (There is an exception mapper there propagating @BendixP FYI, looks like something else in your setup is affecting it, but the NPE guard Georgios is referring to should get the exception returned |
Guard against null headers when converting a provided Response
@sberyozkin I'm going to check it, as soon as I have the time. The setup is not trivial unfortunately. |
@sberyozkin @geoand I tested the same situation with version 3.4.0.CR1. I now receive the correct stack trace of a 401 Error. It looks something like this:
So from my point of view everything is now working as expected and I can properly handle the Error. Thanks for the fast response 👍 |
Thanks for checking @BendixP |
Relates to: quarkusio#35730 (cherry picked from commit c112aa5)
Describe the bug
We have a setup where a User is logged into our Quarkus Application "A" with OIDC through Azure AD. We then make a request to our Application "B" using the quarkus rest client and token propagation (on-behalf-of flow). If the user is not authorized to use that endpoint on Application "B" we get the following stack trace in "A":
Expected behavior
A more descriptive error should be thrown. So that the error can be handled or propagated back to the user.
Actual behavior
A NPE is thrown as seen in the above stack trace.
How to Reproduce?
We use following dependencies. The setup is described above. It is not entirely clear what combination of causes leads to the NPEs.
Output of
uname -a
orver
No response
Output of
java -version
No response
GraalVM version (if different from Java)
No response
Quarkus version or git rev
3.3.1
Build tool (ie. output of
mvnw --version
orgradlew --version
)Apache Maven 3.9.4 (dfbb324ad4a7c8fb0bf182e6d91b0ae20e3d2dd9)
Additional information
We use ubi8/openjdk-17:1.16 docker image
The text was updated successfully, but these errors were encountered: