Good morning everyone, hope this message finds you well! Wondering if there's any changes need to be done to the following lines of code as tt's returning the following exceptions(provided in output section). Your support is highly appreciated. Pls advise. Thanks
code.. starts from here....
public interface AuthService {
@PostMapping(
value = "/oauth/token",
consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE,
//consumes = {"application/x-www-form-urlencoded"},
produces = MediaType.APPLICATION_JSON_VALUE
//produces = {"application/json"}
)
LoginResponse authenticate(
@RequestParam(name = "grant_type") String grantType,
@RequestParam String username,
@RequestParam String password,
@RequestBody String reqBody
) ;}
code....code ends here.
Output:
[AuthService#authenticate(String,String,String,String)]: [{"error":"invalid_request","error_description":"Missing form parameter: grant_type"}]] with root cause feign.FeignException$BadRequest: [400 Bad Request] during [POST]