Search in sources :

Example 1 with Parameter

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);
}
Also used : HashMap(java.util.HashMap) Gson(com.google.gson.Gson) Parameter(com.github.scribejava.core.model.Parameter)

Aggregations

Parameter (com.github.scribejava.core.model.Parameter)1 Gson (com.google.gson.Gson)1 HashMap (java.util.HashMap)1