title: Authentication in Play! and RestEasy
body: <p>I have a small application written in <code>Play!</code> which allows user registration and adding some content for registered users which other registered users can view. I'd like to add some REST API to my application with <code>[resteasy]</code> module, and my question is: are there any best practices or known solutions for performing authentication with rest to allow users managing their own content using resteasy in Play! ?</p>
  
  <p>What I'm thinking about now, are two solutions:</p>
  
  <ol>
  <li>Client sends data and also sends his password and user name in some hashed or encoded form and this data is checked with credentials in database. If there is a match, request action occurs.</li>
  <li>Client authenticates in the first place and is returned sessionId or something which he has to add to all requests (cookie?). </li>
  </ol>
  
  <p>Any help is appreciated. </p>