java.lang.Object
org.eclipse.microprofile.jwt.tck.container.jaxrs.RolesEndpoint

@Path("/endp") @DenyAll @RequestScoped public class RolesEndpoint extends Object
  • Constructor Details

    • RolesEndpoint

      public RolesEndpoint()
  • Method Details

    • echoInput

      @GET @Path("/echo") @RolesAllowed("Echoer") public String echoInput(@Context jakarta.ws.rs.core.SecurityContext sec, @QueryParam("input") String input)
    • echoInputPermitAll

      @GET @Path("/echo-permit-all") @PermitAll public String echoInputPermitAll(@Context jakarta.ws.rs.core.SecurityContext sec, @QueryParam("input") String input)
    • echoInput2

      @GET @Path("/echo2") @RolesAllowed("NoSuchUser") public String echoInput2(@Context jakarta.ws.rs.core.SecurityContext sec, @QueryParam("input") String input)
    • echoNeedsToken2Role

      @GET @Path("/echoNeedsToken2Role") @RolesAllowed("Token2Role") public String echoNeedsToken2Role(@Context jakarta.ws.rs.core.SecurityContext sec, @QueryParam("input") String input)
    • getPrincipalClass

      @GET @Path("/getPrincipalClass") @RolesAllowed("Tester") public String getPrincipalClass(@Context jakarta.ws.rs.core.SecurityContext sec)
      Validate that the SecurityContext#getUserPrincipal is a JsonWebToken
      Parameters:
      sec -
      Returns:
    • needsGroup1Mapping

      @GET @Path("/needsGroup1Mapping") @RolesAllowed("Group1MappedRole") public String needsGroup1Mapping(@Context jakarta.ws.rs.core.SecurityContext sec)
      This endpoint requires a role that is mapped to the group1 role
      Returns:
      principal name
    • checkIsUserInRole

      @GET @Path("/checkIsUserInRole") @RolesAllowed("Tester") public jakarta.ws.rs.core.Response checkIsUserInRole(@Context jakarta.ws.rs.core.SecurityContext sec)
      This endpoint requires a Tester role, and also validates that the caller has the role Echoer by calling SecurityContext.isUserInRole(String).
      Returns:
      principal name or FORBIDDEN error
    • getInjectedPrincipal

      @GET @Path("/getInjectedPrincipal") @RolesAllowed("Tester") public String getInjectedPrincipal(@Context jakarta.ws.rs.core.SecurityContext sec)
    • heartbeat

      @GET @Path("/heartbeat") @PermitAll public String heartbeat()