Im trying to configure oauth2 with spring security, i took an example from
https://github.com/neel4software/SpringSecurityOAuth2
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
this is the GET method URL end point that is working
http://localhost:8080/SpringRestSecurityOauth/oauth/token?grant_type=password&client_id=restapp&client_secret=restapp&username=beingjavaguys&password=spring@java
and this is how the end point configuration done in spring security xml
<http pattern="/oauth/token" create-session="stateless"
authentication-manager-ref="clientAuthenticationManager"
xmlns="http://www.springframework.org/schema/security">
<intercept-url pattern="/oauth/token" access="IS_AUTHENTICATED_FULLY" />
<anonymous enabled="false" />
<http-basic entry-point-ref="clientAuthenticationEntryPoint" />
<!-- include this only if you need to authenticate clients via request
parameters -->
<custom-filter ref="clientCredentialsTokenEndpointFilter"
after="BASIC_AUTH_FILTER" />
<access-denied-handler ref="oauthAccessDeniedHandler" />
</http>
in order to access it using a POST method i have tried to access below end point using
http://localhost:8080/SpringRestSecurityOauth/oauth/token
with the given parameters as a payload in rest client(i have also tried to give these parameters as header parameters)
grant_type: password
client_id: restapp
client_secret: restapp
username: beingjavaguys
password: spring@java
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