-
Notifications
You must be signed in to change notification settings - Fork 41.4k
Description
Hi!
Does anybody encountered the error "Full authentication is required to access this resource" trying to authenticate by using POST request oauth/token?
Curl command:
curl localhost:85/oauth/token -d grant_type=password -d client_id=web_app -d username=reader -d password=reader
Response:
{"timestamp":1486841819620,"status":401,"error":"Unauthorized","message":"Full authentication is required to access this resource","path":"/oauth/token"}
ResourceServerConfiguration configure
http .csrf().disable() .authorizeRequests() .antMatchers("/**").authenticated() .antMatchers(HttpMethod.GET, "/me").hasAuthority("FOO_READ")
WebSecurityConfig configure
http .csrf().disable() .exceptionHandling() .authenticationEntryPoint((request, response, authException) -> response.sendError(HttpServletResponse.SC_UNAUTHORIZED))
Thanks!
SOLUTION
Add in request header Authorization: Basic base64(client_id:client_secret)