question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to use @Authenticated with resteasy-reactive and smallrye jwt with proactive auth disabled

See original GitHub issue

Describe the bug

I’m not 100% sure if this qualifies as a bug or as a “working as intended”.

When you are using resteasy-reactive together with smallrye jwt and turn off the proactive authentication you are unable to use any of the Annotations, @Authenticated @RolesAllowed and @PermitAll as the log says getting the entity would result in a blocking operation. Meaning that those annotations would become useless.

Expected behavior

Check if the JWT is valid or not actually happening.

Actual behavior

RuntimeException stating Cannot call getIdentity() from the IO thread when lazy authentication is in use, as resolving the identity may block the thread. Instead you should inject the CurrentIdentityAssociation, call CurrentIdentityAssociation#getDeferredIdentity() and subscribe to the Uni

To Reproduce

Link to a small reproducer (preferably a Maven project if the issue is not Gradle-specific).

Or attach an archive containing the reproducer to the issue.

Steps to reproduce the behavior:

  1. Create quarkus application with resteasy-reactive and smallrye jwt
  2. Create @Authenticated annotated method
  3. Set quarkus.http.auth.proactive=false
  4. Send a valid or invalid JWT to the endpoint

Configuration

# Add your application.properties here, if applicable.

Screenshots

(If applicable, add screenshots to help explain your problem.) quarkus.http.auth.proactive=false

Environment (please complete the following information):

Output of uname -a or ver

2.11.2(0.329/5/3) 2018-11-10 14:38 x86_64 Msys

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

1.12.1.Final

Build tool (ie. output of mvnw --version or gradlew --version)

Apache Maven 3.6.0

Additional context

(Add any other context about the problem here.)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
sberyozkincommented, Mar 23, 2021

Hey @geonard, there was a discussion at #13835 awhile back, @stuartwdouglas fixed that issue with this commit.

I’m not even sure this issue is specifically related to smallrye-jwt in general since the proactive-auth is disabled and the endpoint is not even expecting JsonWebToken

0reactions
sberyozkincommented, Mar 24, 2021

Hi Stuart @stuartwdouglas that sounds fine, the first resource (or multiple resources accessible directly) in the line is the frontend one so we can say - this is the security wall - anything that follows is not part of this frontend resource security wall (from the point of HTTP level security…). Does it sound reasonable ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using JWT RBAC - Quarkus
This guide explains how your Quarkus application can utilize SmallRye JWT to verify ... needs to authenticate the users using OIDC Authorization Code...
Read more >
How to access JWT in Quarkus when proactive auth is disabled?
I believe you missed something important here. Docs says that : By default, Quarkus does what we call proactive authentication.
Read more >
Home of Quarkus Cheat-Sheet - GitHub Pages
A RESTEasy Reactive-based REST Client extension. ... To disable SSL verification you can use io.quarkus.restclient. ... authentication.disabled.
Read more >
chore(deps): update dependency io.quarkus:quarkus ... - GitLab
... validation with quarkus-resteasy-reactive; #​15935 - Unable to use @​Authenticated with resteasy-reactive and smallrye jwt with proactive auth disabled ...
Read more >
quarkusio/quarkus 2.2.0.Final on GitHub - NewReleases.io
... validation with quarkus-resteasy-reactive; #15935 - Unable to use @authenticated with resteasy-reactive and smallrye jwt with proactive auth disabled.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found