0

I am struggling to get Basic auth working in JAX-WS. All the examples using annotation @BasicAuthenticationMechanismDefinition() (which is how I want to do it) are using servlets. I am new to JAX-WS and was wondering if I should be able to annotate my resource classes (for selected path security) or my application class (for system wide security) in the same way? I have tried something like what I have below without any success.

Any assistance or direction is greatly appreciated.

@BasicAuthenticationMechanismDefinition(realmName = "Basic")    
@DeclareRoles({ "admin", "user", "demo" })
@ServletSecurity(@HttpConstraint(rolesAllowed = "user"))
@Path("/titles")
@RequestScoped
public class TitleResource {

    @GET
    @Produces(MediaType.APPLICATION_JSON)
    @Path("/{reference}")
    public Response titleByReference(@PathParam("reference") final Long titleReference){}

}
seenukarthi
  • 8,241
  • 10
  • 47
  • 68
Damien Cooke
  • 599
  • 10
  • 20

0 Answers0