Package com.streamreduce.connections

Examples of com.streamreduce.connections.OAuthEnabledConnectionProvider


        setIdentityForOauthConnection(connection);
    }

    private void finishHandshakeAndSetRealOauthTokens(Connection connection) {
        ConnectionCredentials credentials = connection.getCredentials();
        OAuthEnabledConnectionProvider oauthProvider =
                connectionProviderFactory.oauthEnabledConnectionProviderFromId(connection.getProviderId());
        OAuthService oAuthService = oauthProvider.getOAuthService();
        Token requestToken = cacheService.retrieveAndRemoveToken(credentials.getOauthToken());
        Token token = oAuthService.getAccessToken(requestToken, new Verifier(credentials.getOauthVerifier()));
        oauthProvider.updateCredentials(credentials, token);
    }
View Full Code Here


        Token token = oAuthService.getAccessToken(requestToken, new Verifier(credentials.getOauthVerifier()));
        oauthProvider.updateCredentials(credentials, token);
    }

    private void setIdentityForOauthConnection(Connection connection) {
        OAuthEnabledConnectionProvider oauthProvider =
                connectionProviderFactory.oauthEnabledConnectionProviderFromId(connection.getProviderId());
        connection.getCredentials().setIdentity(oauthProvider.getIdentityFromProvider(connection));
    }
View Full Code Here

     */
    @Path("providers/{providerId}")
    @GET
    public Response getOAuthDetailsForProvider(@PathParam("providerId") String providerId) {
        try {
            OAuthEnabledConnectionProvider connectionProvider =
                    connectionProviderFactory.oauthEnabledConnectionProviderFromId(providerId);
            String authorizationUrl = connectionProvider.getAuthorizationUrl();
            JSONObject providerOAuthDetail = new JSONObjectBuilder()
                    .add("authorizationUrl",authorizationUrl)
                    .build();
            return Response.ok(providerOAuthDetail).build();
        } catch (NoSuchElementException e) {
View Full Code Here

TOP

Related Classes of com.streamreduce.connections.OAuthEnabledConnectionProvider

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.