title: How to do Rest Authentication with JAX-RS
body: <p>I am looking for some pointers on how to secure my rest root resource </p>
  
  <pre><code>@Path("/employee")
  public class EmployeeResource {
  
      @GET
      @Produces("text/html")
      public String get(
          @QueryParam("name") String empname,
          @QueryParam("sn") String sn) {
  
           // Return a data back.
      }
  }
  </code></pre>
  
  <p>I have read post's regarding basic authetication and OAuth, I know the concept but i am looking for ways on how to implement it in code.</p>
  
  <p>Thanks</p>