use of com.github.scribejava.core.model.Parameter in project scribejava by scribejava.
the class OAuth20ServiceUnit method prepareRawResponse.
private String prepareRawResponse(OAuthRequest request) {
final Gson json = new Gson();
final Map<String, String> response = new HashMap<>();
response.put(OAuthConstants.ACCESS_TOKEN, TOKEN);
response.put(OAuthConstants.STATE, STATE);
response.put("expires_in", EXPIRES);
response.putAll(request.getHeaders());
response.putAll(request.getOauthParameters());
for (Parameter p : request.getBodyParams().getParams()) {
response.put("query-" + p.getKey(), p.getValue());
}
return json.toJson(response);
}