0 Replies Latest reply on Jul 2, 2014 2:36 AM by l l

    REST WebService authentication

    l l Newbie

      Hi,

      I'd like to authenticate a REST Webservice deployed on WildFly 8.0.0

       

      At the moment I've only added these annotation to my RESTWS class:

       

       

      .....

      @Stateless

      @SecurityDomain("other")

      @Path("/mypath")

      public class myRestWS {

       

        @PermitAll

        @GET

        @Path("/a")

        @Produces(MediaType.APPLICATION_JSON)

        public String getA() throws NamingException {

        .....

        }

       

        @RolesAllowed({ "SuperUser" })

        @GET

        @Path("/b")

        @Produces(MediaType.APPLICATION_JSON)

        public String getB()

        .....

        }

      .....

       

       

      I can invoke method getA, while when I try to invoke method getB using BasicAuthentication, I've this exception:

       

       

      Caused by: javax.ejb.EJBAccessException:

      JBAS014502: Invocation on method: public java.lang.String .......

      myRestWS.getB(java.lang.String) throws javax.naming.NamingException of bean: myRestWS is not allowed

       

       

      thanks in advance