Package org.scribe.builder

Examples of org.scribe.builder.ServiceBuilder


        if (StringUtils.isEmpty(usersMeUrl)) {
            logger.warn("configured users me URL is empty");
        }

        if (!StringUtils.isEmpty(consumerKey) && !StringUtils.isEmpty(consumerSecret) && !StringUtils.isEmpty(callbackUrl)) {
            oAuthService = new ServiceBuilder().provider(XingApi.class).apiKey(consumerKey).apiSecret(consumerSecret).callback(callbackUrl).build();
        } else {
            oAuthService = null;
        }

        logger.info("configured with consumer key '{}', callback url '{}' and users me url '{}'", consumerKey, callbackUrl, usersMeUrl);
View Full Code Here


        }
        return request;
    }

    public void setConsumer(String consumerKey, String consumerSecret) {
        service = new ServiceBuilder().
        provider(TumblrApi.class).
        apiKey(consumerKey).apiSecret(consumerSecret).
        build();
    }
View Full Code Here

        String state = RandomStringUtils.randomAlphabetic(10);
        String key = RandomStringUtils.randomAlphabetic(10);
        String secret = RandomStringUtils.randomAlphabetic(10);
        LinkedInApi20 api = new LinkedInApi20(state);

        OAuthService service = new ServiceBuilder().provider(api).apiKey(key).apiSecret(secret)
                .callback("http://localhost:4502/linkedin").build();

        String expected = "https://www.linkedin.com/uas/oauth2/authorization?response_type=code&client_id=" + key
                + "&state=" + state + "&redirect_uri=" + OAuthEncoder.encode("http://localhost:4502/linkedin");
View Full Code Here

        String state = RandomStringUtils.randomAlphabetic(10);
        String key = RandomStringUtils.randomAlphabetic(10);
        String secret = RandomStringUtils.randomAlphabetic(10);
        LinkedInApi20 api = new LinkedInApi20(state);

        OAuthService service = new ServiceBuilder().provider(api).apiKey(key).apiSecret(secret)
                .callback("http://localhost:4502/linkedin").scope("r_basicprofile,r_emailaddress")
                .build();

        String expected = "https://www.linkedin.com/uas/oauth2/authorization?response_type=code&client_id=" + key
                + "&state=" + state + "&redirect_uri=" + OAuthEncoder.encode("http://localhost:4502/linkedin")
View Full Code Here

        httpResponse.sendRedirect(httpRequest.getServletContext().getContextPath() + "/");
    }

    private OAuthService getOAuthService(HttpServletRequest request, boolean withCallback) {
        ServiceBuilder builder = new ServiceBuilder()
                .provider(TwitterApi.SSL.Authenticate.class)
                .apiKey(config.getKey())
                .apiSecret(config.getSecret());

        if (withCallback) {
            builder.callback(request.getRequestURL().toString());
        }

        return builder.build();
    }
View Full Code Here

                    ", redirectURL=" + redirectURL);
        }

        this.chunkLength = OAuthPersistenceUtils.getChunkLength(params);

        this.oAuthService = new ServiceBuilder()
                                        .provider(LinkedInApi.class)
                                        .apiKey(apiKey)
                                        .apiSecret(apiSecret)
                                        .callback(redirectURL)
                                        .build();
View Full Code Here

    }

    @Override
    public InteractionState<LinkedinAccessTokenContext> processOAuthInteraction(HttpServletRequest httpRequest, HttpServletResponse httpResponse, String scope) throws IOException, OAuthException {
        if(scope != null) {
            this.oAuthService = new ServiceBuilder()
                    .provider(LinkedInApi.class)
                    .apiKey(apiKey)
                    .apiSecret(apiSecret)
                    .scope(scope)
                    .callback(redirectURL)
                    .build();
        } else {
            this.oAuthService = new ServiceBuilder()
                    .provider(LinkedInApi.class)
                    .apiKey(apiKey)
                    .apiSecret(apiSecret)
                    .callback(redirectURL)
                    .build();
View Full Code Here

  public void setClientip(String clientip) {
    this.clientip = clientip;
  }

  public OAuthService getOAuthService() {
    return new ServiceBuilder()
        .provider(TencentApi.class)
        .apiKey(apiKey)
        .apiSecret(apiSecret)
        .signatureType(SignatureType.QueryString)
        .build();
View Full Code Here

        .signatureType(SignatureType.QueryString)
        .build();
  }

  public OAuthService getOAuthService(String callback) {
    return new ServiceBuilder()
          .provider(TencentApi.class)
          .apiKey(apiKey)
          .apiSecret(apiSecret)
          .callback(callback)
          .signatureType(SignatureType.QueryString)
View Full Code Here

    this.apiKey = apiKey;
    this.apiSecret = apiSecret;
  }

  public OAuthService getOAuthService() {
    return new ServiceBuilder()
        .provider(SinaApi.class)
        .apiKey(apiKey)
        .apiSecret(apiSecret)
        .build();
  }
View Full Code Here

TOP

Related Classes of org.scribe.builder.ServiceBuilder

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.