Package com.google.gdata.client.authn.oauth

Examples of com.google.gdata.client.authn.oauth.OAuthHmacSha1Signer


            oauthParameters.setOAuthConsumerKey(USER_NAME);
            // Setting above assigned consumer secret
            oauthParameters.setOAuthConsumerSecret(CONSUMER_SECRET);

            // We will be using HMAC-SHA1 signature. Google API has a class to do that
            OAuthHmacSha1Signer signer = new OAuthHmacSha1Signer();

            // Create a Google service. The name of the current application given here
            // Names are only for reference purpose
            GoogleService service = new GoogleService("oauthclient", "sampleapp");
            service.setOAuthCredentials(oauthParameters, signer);
View Full Code Here


        oauthParameters.setOAuthConsumerSecret(getOAuthSecretKey(oauthConsumer
                .getOauthConsumerKey()));
        oauthParameters.setOAuthNonce(oauthConsumer.getOauthNonce());
        oauthParameters.setOAuthTimestamp(oauthConsumer.getOauthTimeStamp());
        oauthParameters.setOAuthSignatureMethod(oauthConsumer.getOauthSignatureMethod());
        OAuthHmacSha1Signer signer = new OAuthHmacSha1Signer();
        String baseString = OAuthUtil.getSignatureBaseString(oauthConsumer.getBaseString(),
                oauthConsumer.getHttpMethod(), oauthParameters.getBaseParameters());
        String signature = signer.getSignature(baseString, oauthParameters);

        if (signature != null
                && URLEncoder.encode(signature).equals(oauthConsumer.getOauthSignature())) {
            return true;
        } else if (signature != null && signature.equals(oauthConsumer.getOauthSignature())) {
View Full Code Here

      params.setOAuthConsumerKey(accessor.consumer.consumerKey);
      params.setOAuthConsumerSecret(accessor.consumer.consumerSecret);
      params.setOAuthToken(accessor.accessToken);
      params.setOAuthTokenSecret(accessor.tokenSecret);

      OAuthSigner signer = new OAuthHmacSha1Signer();

      service.setOAuthCredentials(params, signer);

      ContactFeed resultFeed;
      try {
View Full Code Here

        oauthParameters.setOAuthConsumerSecret(consumerSecret);
        System.out.println(consumerKey + " " + consumerSecret);
        oauthParameters.setOAuthType(OAuthParameters.OAuthType.TWO_LEGGED_OAUTH);
        calendarService = new CalendarService("marketplace-hello");
        try {
            calendarService.setOAuthCredentials(oauthParameters, new OAuthHmacSha1Signer());
        } catch (OAuthException e) {
            throw new ServletException("Unable to initialize calendar service", e);
        }
    }
View Full Code Here

        oauthParameters.setOAuthConsumerKey(consumerKey);
        oauthParameters.setOAuthConsumerSecret(consumerSecret);

        calendarService = new CalendarService("marketplace-hello");
        try {
            calendarService.setOAuthCredentials(oauthParameters, new OAuthHmacSha1Signer());
        } catch (OAuthException e) {
            throw new ServletException("Unable to initialize calendar service", e);
        }
    }
View Full Code Here

     * @throws Exception
     */
    OAuthHelper newOAuthHelper() throws Exception {
        OAuthSigner signer = null;
        if (getKeyLoader() == null) {
            signer = new OAuthHmacSha1Signer();
        } else {
            signer = new OAuthRsaSha1Signer(getPrivateKey());
        }
        return new GoogleOAuthHelper(signer);
    }
View Full Code Here

     * on this endpoint's properties.
     */
    OAuthHelper newOAuthHelper() throws Exception {
        OAuthSigner signer = null;
        if (getKeyLoader() == null) {
            signer = new OAuthHmacSha1Signer();
        } else {
            signer = new OAuthRsaSha1Signer(getPrivateKey());
        }
        return new GoogleOAuthHelper(signer);
    }
View Full Code Here

      case RSA:
        signer = new OAuthRsaSha1Signer(variables.getSignatureKey());
        break;
      case HMAC:
        oauthParameters.setOAuthConsumerSecret(variables.getSignatureKey());
        signer = new OAuthHmacSha1Signer();
        break;
      default:
        throw new IllegalArgumentException("Invalid Signature Method");
    }
View Full Code Here

    // Initialize the OAuth Signer.  2-Legged OAuth must use HMAC-SHA1, which
    // uses the OAuth Consumer Secret to sign the request.  The OAuth Consumer
    // Secret can be obtained at https://www.google.com/accounts/ManageDomains.
    oauthParameters.setOAuthConsumerSecret(variables.getSignatureKey());
    OAuthSigner signer = new OAuthHmacSha1Signer();

    // Finally create a new GoogleOAuthHelperObject.  This is the object you
    // will use for all OAuth-related interaction.
    GoogleOAuthHelper oauthHelper = new GoogleOAuthHelper(signer);
View Full Code Here

      GoogleOAuthParameters oauthParameters = new GoogleOAuthParameters();
      oauthParameters.setOAuthConsumerKey(consumerKey);
      oauthParameters.setOAuthConsumerSecret(consumerSecret);

      this.myService = new ContactsService("GoogleInc-UnshareProfiles-1");
      this.myService.setOAuthCredentials(oauthParameters, new OAuthHmacSha1Signer());
    }
View Full Code Here

TOP

Related Classes of com.google.gdata.client.authn.oauth.OAuthHmacSha1Signer

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.