title: How can i use SecurityContext in Jax-RS to get Token of a specified user?
body: <p>Can i do this? I am using SecurityContext of Jax-rs to get current Student </p>
  
  <pre><code> @GET 
      @Secured
      @Path("/books") 
      @Produces("application/json")
      public List&lt;Book&gt; getBooks(@Context SecurityContext securityContext){ 
          Student s = (Student)securityContext.getUserPrincipal();
          TypedQuery&lt;Book&gt; query = em.createQuery("SELECT s.books from Student s where s.token = :token", Book.class);
          query.setParameter("token", s.getToken());
          List&lt;Book&gt; resultList = query.getResultList();
          return resultList;  
  </code></pre>