From 149162a2ed27c2192e7cf3534f29afa6096e6e95 Mon Sep 17 00:00:00 2001 From: Paul Robinson Date: Fri, 17 May 2024 17:05:30 +0100 Subject: [PATCH 1/2] Specified @RequestScoped to SecureResource @Claim must be injected into @ApplicationScoped or @Singleton scoped beans. See: https://github.com/quarkusio/quarkus/pull/36183 --- documentation/modules/ROOT/pages/12_security.adoc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/documentation/modules/ROOT/pages/12_security.adoc b/documentation/modules/ROOT/pages/12_security.adoc index 14317ec..1cc81cb 100644 --- a/documentation/modules/ROOT/pages/12_security.adoc +++ b/documentation/modules/ROOT/pages/12_security.adoc @@ -98,10 +98,13 @@ package com.redhat.developers; import jakarta.ws.rs.GET; import jakarta.ws.rs.Path; +import jakarta.enterprise.context.RequestScoped; + import org.eclipse.microprofile.jwt.Claim; import org.eclipse.microprofile.jwt.Claims; @Path("secure") +@RequestScoped public class SecureResource { @Claim(standard = Claims.preferred_username) From ce02599f830ed785f822c087969c9b8b1398ab23 Mon Sep 17 00:00:00 2001 From: Paul Robinson Date: Fri, 17 May 2024 17:10:17 +0100 Subject: [PATCH 2/2] Specified @RequestScoped to SecureResource @claim must be injected into @ApplicationScoped or @singleton scoped beans. See: quarkusio/quarkus#36183 --- documentation/modules/ROOT/pages/12_security.adoc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/documentation/modules/ROOT/pages/12_security.adoc b/documentation/modules/ROOT/pages/12_security.adoc index 1cc81cb..e083442 100644 --- a/documentation/modules/ROOT/pages/12_security.adoc +++ b/documentation/modules/ROOT/pages/12_security.adoc @@ -187,10 +187,13 @@ import jakarta.annotation.security.RolesAllowed; import jakarta.ws.rs.GET; import jakarta.ws.rs.Path; +import jakarta.enterprise.context.RequestScoped; + import org.eclipse.microprofile.jwt.Claim; import org.eclipse.microprofile.jwt.Claims; @Path("/secure") +@RequestScoped public class SecureResource { @Claim(standard = Claims.preferred_username) @@ -236,10 +239,13 @@ import jakarta.annotation.security.RolesAllowed; import jakarta.ws.rs.GET; import jakarta.ws.rs.Path; +import jakarta.enterprise.context.RequestScoped; + import org.eclipse.microprofile.jwt.Claim; import org.eclipse.microprofile.jwt.Claims; @Path("/secure") +@RequestScoped public class SecureResource { @Claim(standard = Claims.preferred_username)