Package org.restlet.ext.oauth.internal

Examples of org.restlet.ext.oauth.internal.JsonStringRepresentation


                    "Failed parse JSON", e);
        } catch (IOException e) {
            throw new ResourceException(Status.CLIENT_ERROR_BAD_REQUEST,
                    "Failed parse JSON", e);
        }
        return new JsonStringRepresentation(response);
    }
View Full Code Here


            JSONObject request;
            try {
                request = createValidationRequest(accessToken, req);
                // Representation repr = this.createJsonRepresentation(request);
                Representation repr = new JsonStringRepresentation(request);
                getLogger().info("Posting to validator... json = " + request);
                // RETRIEVE JSON...WORKAROUND TO HANDLE ANDROID
                Representation r = authResource.post(repr);
                getLogger().info("After posting to validator...");
                repr.release();
                getLogger().info(
                        "Got Respose from auth resource OK "
                                + r.getClass().getCanonicalName());
                JsonRepresentation returned = new JsonRepresentation(r);
View Full Code Here

        JSONObject body = createJsonToken(token, null);

        // Sets the no-store Cache-Control header
        getResponse().setCacheDirectives(noStore);
        return new JsonStringRepresentation(body);
    }
View Full Code Here

        Token token = generator.generateToken(user, tokenTimeSec);
        JSONObject body = createJsonToken(token, null); // Scopes N/A

        // Sets the no-store Cache-Control header
        getResponse().setCacheDirectives(noStore);
        return new JsonStringRepresentation(body);
    }
View Full Code Here

        Token token = generator.generateToken(user, tokenTimeSec);
        JSONObject body = createJsonToken(token, null); // Scopes N/A

        // Sets the no-store Cache-Control header
        getResponse().setCacheDirectives(noStore);
        return new JsonStringRepresentation(body);
    }
View Full Code Here

                JSONObject body = createJsonToken(token, null); // Scopes N/A

                // Sets the no-store Cache-Control header
                getResponse().setCacheDirectives(noStore);
                return new JsonStringRepresentation(body);
            } else { // error not owner
                setStatus(Status.CLIENT_ERROR_FORBIDDEN);
                return sendError(OAuthError.UNAUTHORIZED_CLIENT,
                        "User does not match.", null);
View Full Code Here

            }

            if (errorUri != null && errorUri.length() > 0) {
                result.put(OAuthServerResource.ERROR_URI, errorUri);
            }
            return new JsonStringRepresentation(result);
        } catch (JSONException e) {
            getLogger().log(Level.WARNING, "Error while sending OAuth error.",
                    e);
        }
        return null;
View Full Code Here

TOP

Related Classes of org.restlet.ext.oauth.internal.JsonStringRepresentation

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.