I have following request body.
BODY: code=471b001b-432f-3172-b59f-2b03c7847cf6&client_secret=AtO0zxf62KoYasYTobOGRXVRZXsa&grant_type=authorization_code&client_id=4rYClwGnY4CE_XXAkMCoWuI4mnIa&redirect_uri=https%3A%2F%2Fop.certification.openid.net%3A60746%2Fauthz_cb
I need to read the client_secret parameter from the request body. I'm using below code to read the request body.
Scanner scanner = null;
try {
scanner = new Scanner(request.getInputStream());
} catch (IOException e) {
}
while (scanner.hasNextLine()) {
stringBuilder.append(scanner.nextLine());
}
String requestBody = stringBuilder.toString();
I can create a logic to get the value of client_secret parameter from the requestBody String. But I need to know whether we have a direct way to read parameters from a HTTPRequest Body.
Any suggestion will be highly appreciated.
Thanks.