title: How to get the OAuth2 access token using Post method
body: <p>Im trying to configure oauth2 with spring security, i took an example from </p>
  
  <pre><code>https://github.com/neel4software/SpringSecurityOAuth2
  </code></pre>
  
  <p>now my problem is i need to get an oauth2 access token using a post method instead of get, below is how the token end point is configured in spring security xml</p>
  
  <p>this is the GET method URL end point that is working</p>
  
  <pre><code>http://localhost:8080/SpringRestSecurityOauth/oauth/token?grant_type=password&amp;client_id=restapp&amp;client_secret=restapp&amp;username=beingjavaguys&amp;password=spring@java 
  </code></pre>
  
  <p>and this is how the end point configuration done in spring security xml</p>
  
  <pre><code>&lt;http pattern="/oauth/token" create-session="stateless"
          authentication-manager-ref="clientAuthenticationManager"
          xmlns="http://www.springframework.org/schema/security"&gt;
          &lt;intercept-url pattern="/oauth/token" access="IS_AUTHENTICATED_FULLY" /&gt;
          &lt;anonymous enabled="false" /&gt;
          &lt;http-basic entry-point-ref="clientAuthenticationEntryPoint" /&gt;
          &lt;!-- include this only if you need to authenticate clients via request 
              parameters --&gt;
          &lt;custom-filter ref="clientCredentialsTokenEndpointFilter"
              after="BASIC_AUTH_FILTER" /&gt;
          &lt;access-denied-handler ref="oauthAccessDeniedHandler" /&gt;
      &lt;/http&gt;
  </code></pre>
  
  <p>in order to access it using a POST method i have tried to access below end point using </p>
  
  <pre><code>http://localhost:8080/SpringRestSecurityOauth/oauth/token
  </code></pre>
  
  <p>with the given parameters as a payload in rest client(i have also tried to give these parameters as header parameters)</p>
  
  <pre><code>grant_type: password
  client_id: restapp
  client_secret: restapp
  username: beingjavaguys
  password: spring@java
  </code></pre>
  
  <p>but each time i tried to access it using rest client it allways prompt me for a username and password which i don't know. i gave username as "beingjavaguys" and password as "spring@java" which didn't work. im using Oauth2 in first time</p>