Class RolesEndpoint
java.lang.Object
org.eclipse.microprofile.jwt.tck.container.jaxrs.RolesEndpoint
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionjakarta.ws.rs.core.ResponsecheckIsUserInRole(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).echoInput2(jakarta.ws.rs.core.SecurityContext sec, String input) echoInputPermitAll(jakarta.ws.rs.core.SecurityContext sec, String input) echoNeedsToken2Role(jakarta.ws.rs.core.SecurityContext sec, String input) getInjectedPrincipal(jakarta.ws.rs.core.SecurityContext sec) getPrincipalClass(jakarta.ws.rs.core.SecurityContext sec) Validate that the SecurityContext#getUserPrincipal is a JsonWebTokenneedsGroup1Mapping(jakarta.ws.rs.core.SecurityContext sec) This endpoint requires a role that is mapped to the group1 role
-
Constructor Details
-
RolesEndpoint
public RolesEndpoint()
-
-
Method Details
-
echoInput
-
echoInputPermitAll
-
echoInput2
-
echoNeedsToken2Role
-
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
-