title: Authentication in Jersey
body: <p>I want to implement authentication for my Jersey0based server/client REST but I'm not sure how exactly to lay out the code. </p>
  
  <p>Basically for every operation I have 2 methods - 1 from the server side, 1 from the client side. </p>
  
  <p>I've narrowed down the algorithm - I'm going to use the amazon strategy with HMAC. </p>
  
  <p>The question is how to lay out this in the code - should I add the authentication (encryption/decryption code) into every method - both server/client side or should I have one "dispatch" method on both sides which would perform the encryption/decryption and then will transfer execution control to a more specialized version that way I  will have 1 central place where authentication is done in both the client or the server? </p>
  
  <p>I'm willing to hear your comments on that?</p>