Package org.scribe.builder

Examples of org.scribe.builder.ServiceBuilder


        .apiSecret(apiSecret)
        .build();
  }

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


        OAuthService service = null;
        switch(authProvider)
        {
            case ClientUtils.FACEBOOK:
            {
                service = new ServiceBuilder()
                    .provider(FacebookApi.class)
                    .apiKey(ServerUtils.FACEBOOK_APP_ID)
                    .apiSecret(ServerUtils.FACEBOOK_APP_SECRET)
                    .callback(ClientUtils.getCallbackUrl())
                    .build();
                break;
            }
           
            case ClientUtils.GOOGLE:
            {
                service = new ServiceBuilder()
                    .provider(GoogleApi20.class)
                    .apiKey(ServerUtils.GOOGLE_APP_ID)
                    .apiSecret(ServerUtils.GOOGLE_APP_SECRET)
                    .scope(ServerUtils.GOOGLE_SCOPE)
                    .callback(ClientUtils.getCallbackUrl())
                    .grantType(OAuthConstants.AUTHORIZATION_CODE)
                    .build();
               
                break;
            }
           
            case ClientUtils.TWITTER:
            {
                service = new ServiceBuilder()
                    .provider(TwitterApi.class)
                    .apiKey(ServerUtils.TWITTER_APP_ID)
                    .apiSecret(ServerUtils.TWITTER_APP_SECRET)
                    .callback(ClientUtils.getCallbackUrl())
                    .build();
                break;
            }
            case ClientUtils.YAHOO:
            {
                service = new ServiceBuilder()
                    .provider(YahooApi.class)
                    .apiKey(ServerUtils.YAHOO_APP_ID)
                    .apiSecret(ServerUtils.YAHOO_APP_SECRET)
                    .callback(ClientUtils.getCallbackUrl())
                    .build();
                break;
            }
           
            case ClientUtils.LINKEDIN:
            {
                service = new ServiceBuilder()
                    .provider(LinkedInApi.class)
                    .apiKey(ServerUtils.LINKEDIN_APP_ID)
                    .apiSecret(ServerUtils.LINKEDIN_APP_SECRET)
                    .callback(ClientUtils.getCallbackUrl())
                    .build();
                break;
            }
           
            case ClientUtils.INSTAGRAM:
            {
                service = new ServiceBuilder()
                .provider(InstagramApi.class)
                    .apiKey(ServerUtils.INSTAGRAM_APP_ID)
                    .apiSecret(ServerUtils.INSTAGRAM_APP_SECRET)
                    .grantType(OAuthConstants.AUTHORIZATION_CODE)
                    .callback(ClientUtils.getCallbackUrl())
                    .build();
                break;
            }
           
            case ClientUtils.GITHUB:
            {
                service = new ServiceBuilder()
                .provider(GithubApi.class)
                    .apiKey(ServerUtils.GITHUB_APP_ID)
                    .apiSecret(ServerUtils.GITHUB_APP_SECRET)
                    .callback(ClientUtils.getCallbackUrl())
                    .build();
                break;
               
            }
           
            case ClientUtils.IMGUR:
            {
                service = new ServiceBuilder()
                .provider(ImgUrApi.class)
                    .apiKey(ServerUtils.IMGUR_APP_ID)
                    .apiSecret(ServerUtils.IMGUR_APP_SECRET)
                    .callback(ClientUtils.getCallbackUrl())
                    .build();
                break;
            }
           
            case ClientUtils.FLICKR:
            {
                service = new ServiceBuilder()
                .provider(FlickrApi.class)
                    .apiKey(ServerUtils.FLICKR_APP_ID)
                    .apiSecret(ServerUtils.FLICKR_APP_SECRET)
                    .callback(ClientUtils.getCallbackUrl())
                    .build();
                break;
            }
           
            case ClientUtils.VIMEO:
            {
                service = new ServiceBuilder()
                .provider(VimeoApi.class)
                    .apiKey(ServerUtils.VIMEO_APP_ID)
                    .apiSecret(ServerUtils.VIMEO_APP_SECRET)
                    .callback(ClientUtils.getCallbackUrl())
                    .build();
                break;
            }
           
            case ClientUtils.WINDOWS_LIVE:
            {
                // a Scope must be specified
                service = new ServiceBuilder()
                .provider(LiveApi.class)
                    .apiKey(ServerUtils.WINDOWS_LIVE_APP_ID)
                    .apiSecret(ServerUtils.WINDOWS_LIVE_APP_SECRET)
                    .callback(ClientUtils.getCallbackUrl())
                    .scope("wl.basic")
                    .build();
                break;
            }
           
            case ClientUtils.TUMBLR:
            {
                service = new ServiceBuilder()
                .provider(TumblrApi.class)
                    .apiKey(ServerUtils.TUMBLR_LIVE_APP_ID)
                    .apiSecret(ServerUtils.TUMBLR_LIVE_APP_SECRET)
                    .callback(ClientUtils.getCallbackUrl())
                    .build();
                break;
            }
           
            case ClientUtils.FOURSQUARE:
            {
                service = new ServiceBuilder()
                .provider(Foursquare2Api.class)
                    .apiKey(ServerUtils.FOURSQUARE_APP_ID)
                    .apiSecret(ServerUtils.FOURSQUARE_APP_SECRET)
                    .callback(ClientUtils.getCallbackUrl())
                    .build();
View Full Code Here

          final String clientSecret = clientSecretEngineSettingValue.getValue();
          final String permissions = permissionsEngineSettingValue.getValue();
         
          final String facebookCallBackURL = urlService.buildAbsoluteUrl(requestData, urlService.buildOAuthCallBackUrl(requestData, OAuthType.FACEBOOK.getPropertyKey().toLowerCase()));

            OAuthService service = new ServiceBuilder()
                    .provider(FacebookApi.class)
                    .apiKey(clientId)
                    .apiSecret(clientSecret)
                    .scope(permissions)
                    .callback(facebookCallBackURL)
View Full Code Here

          final String clientSecret = clientSecretEngineSettingValue.getValue();
          final String permissions = permissionsEngineSettingValue.getValue();

          final String windowsLiveCallBackURL = urlService.buildAbsoluteUrl(requestData, urlService.buildOAuthCallBackUrl(requestData, OAuthType.WINDOWS_LIVE.getPropertyKey().toLowerCase()));

            OAuthService service = new ServiceBuilder()
                    .provider(LiveApi.class)
                    .apiKey(clientId)
                    .apiSecret(clientSecret)
                    .scope(permissions)
                    .callback(windowsLiveCallBackURL)
View Full Code Here

          final String clientId = clientIdEngineSettingValue.getValue();
          final String clientSecret = clientSecretEngineSettingValue.getValue();
         
          final String twitterCallBackURL = urlService.buildAbsoluteUrl(requestData, urlService.buildOAuthCallBackUrl(requestData, OAuthType.TWITTER.getPropertyKey().toLowerCase()));

            OAuthService service = new ServiceBuilder()
                    .provider(TwitterApi.class)
                    .apiKey(clientId)
                    .apiSecret(clientSecret)
                    .callback(twitterCallBackURL)
                    .build();
View Full Code Here

          final String clientId = clientIdEngineSettingValue.getValue();
          final String clientSecret = clientSecretEngineSettingValue.getValue();

          final String twitterCallBackURL = urlService.buildAbsoluteUrl(requestData, urlService.buildOAuthCallBackUrl(requestData, OAuthType.TWITTER.getPropertyKey().toLowerCase()));

            OAuthService service = new ServiceBuilder()
                    .provider(TwitterApi.class)
                    .apiKey(clientId)
                    .apiSecret(clientSecret)
                    .callback(twitterCallBackURL)
                    .build();
View Full Code Here

          final String clientSecret = clientSecretEngineSettingValue.getValue();
          final String permissions = permissionsEngineSettingValue.getValue();

                    final String googleAccountCallBackURL = urlService.buildAbsoluteUrl(requestData, urlService.buildOAuthCallBackUrl(requestData, OAuthType.GOOGLE_ACCOUNT.getPropertyKey().toLowerCase()));

                    OAuthService service = new ServiceBuilder()
                    .provider(Google2Api.class)
                    .apiKey(clientId)
                    .apiSecret(clientSecret)
                    .scope(permissions)
                    .callback(googleAccountCallBackURL)
View Full Code Here

          final String clientSecret = clientSecretEngineSettingValue.getValue();
          final String permissions = permissionsEngineSettingValue.getValue();

          final String facebookCallBackURL = urlService.buildAbsoluteUrl(requestData, urlService.buildOAuthCallBackUrl(requestData, OAuthType.FACEBOOK.getPropertyKey().toLowerCase()));

            OAuthService service = new ServiceBuilder()
                    .provider(FacebookApi.class)
                    .apiKey(clientId)
                    .apiSecret(clientSecret)
                    .scope(permissions)
                    .callback(facebookCallBackURL)
View Full Code Here

          final String clientSecret = clientSecretEngineSettingValue.getValue();
          final String permissions = permissionsEngineSettingValue.getValue();
         
          final String windowsLiveCallBackURL = urlService.buildAbsoluteUrl(requestData, urlService.buildOAuthCallBackUrl(requestData, OAuthType.WINDOWS_LIVE.getPropertyKey().toLowerCase()));

            OAuthService service = new ServiceBuilder()
                    .provider(LiveApi.class)
                    .apiKey(clientId)
                    .apiSecret(clientSecret)
                    .scope(permissions)
                    .callback(windowsLiveCallBackURL)
View Full Code Here

          final String clientSecret = clientSecretEngineSettingValue.getValue();
          final String permissions = permissionsEngineSettingValue.getValue();
         
            final String googleAccountCallBackURL = urlService.buildAbsoluteUrl(requestData, urlService.buildOAuthCallBackUrl(requestData, OAuthType.GOOGLE_ACCOUNT.getPropertyKey().toLowerCase()));

              OAuthService service = new ServiceBuilder()
              .provider(Google2Api.class)
              .apiKey(clientId)
              .apiSecret(clientSecret)
              .scope(permissions)
                .callback(googleAccountCallBackURL)
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.