title: Spring security OAuth2 accept JSON
body: <p>I am starting with Spring OAuth2. I would like to send the username and password to /oauth/token endpoint in POST body in application/json format.</p>
  
  <pre><code>curl -X POST -H "Authorization: Basic YWNtZTphY21lc2VjcmV0" -H "Content-Type: application/json" -d '{
  "username": "user",
  "password": "password",
  "grant_type": "password"
  }' "http://localhost:9999/api/oauth/token"
  </code></pre>
  
  <p>Is that possible?</p>
  
  <p>Could you please give me an advice?</p>