title: How to get Authenticated with spring security rest plugin in Grails
body: <p>I'm using Grails version 2.4.3 . I am creating an application that supports RESTful APIs. Since  access to these APIs should be authenticated , I tried out the Spring Security REST plugin. I checked out <a href="https://github.com/alvarosanchez/restful-grails-springsecurity-greach2014" rel="nofollow">this example</a> and what I could understand is , the <code>/api/login</code> controller is the authentication point which receives the user credentials in JSON format and after successful authentication it provides the acces token as response. I tried sending a POST request to <code>/api/login/</code> with valid JSON data using the <a href="http://www.getpostman.com/" rel="nofollow">POSTMAN Rest Client</a>. But it gives me the following error.</p>
  
  <pre><code>401 Unauthorized , Similar to 403 Forbidden, but specifically for use when authentication is possible but has failed or not yet been provided. The response must include a WWW-Authenticate header field containing a challenge applicable to the requested resource.
  </code></pre>
  
  <p>I also tried using IntellijIDEA's REST Client but doesn't work.
  Then i tried by sending AJAX Request to <code>/api/login/</code> with valid JSON data
  , but getting 401 on console. What is the problem here?  Is this the correct login end point? How can i get authenticated using JQuery?</p>