java - Spring. How to properly configure WebSecurityConfigurerAdapter when using OAuth? -
i working on own oauth implementation spring boot. using authorization_code flow authorize mobile clients.
here configuration:
protected void configure(httpsecurity http) throws exception { http .formlogin() .and() .httpbasic().disable() .anonymous().disable() .authorizerequests().anyrequest().authenticated(); }
so client calls oauth/authorize endpoint , redirects user login form. once user signs in , allows access, app receives authorization_code authorisation server.
however, when requesting token given authorization_code, app receives following response server:
full authentication required access resource: oauth/token
do guys know why may happen?
i have tried curl it:
curl -f grant_type=authorization_code \ -f client_id=iosapp \ -f code=sxxr2l \ -f redirect_uri=com.iosapp.myapp://oauthredirect \ -x post http://localhost:8080/oauth/token
but got same error:
{"timestamp":1500929133281,"status":401,"error":"unauthorized","message":"full authentication required access resource","path":"/oauth/token"}
Comments
Post a Comment