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

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


      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


   * @param requestQuery the queryString that has a token parameter with the value of a
   *     single use authSub token.
   * @return the session token or null if no token was retrieved.
   */
  public String getSessionTokenFromString(String requestQuery) {
    OAuthSigner signer = null;

    try {
      // Step 7. Exchange authorized request token for access token.
      signer = new OAuthRsaSha1Signer(getPrivateKey());
      GoogleOAuthHelper oauthHelper = new GoogleOAuthHelper(signer);
View Full Code Here

  /**
   * Revokes the authorization token for the current user.
   * @param userToken Contains the token to revoke.
   */
  public void revokeToken(UserToken userToken) {
    OAuthSigner signer = null;
    oAuthParameters.setOAuthToken(userToken.getSessionToken());

    try {
      signer = new OAuthRsaSha1Signer(getPrivateKey());
      GoogleOAuthHelper oauthHelper = new GoogleOAuthHelper(signer);
View Full Code Here

        authServiceError = e.getMessage();
    }
  }

  public void putTokenInGoogleService(UserToken userToken, GoogleService googleService) {
    OAuthSigner signer = null;
    oAuthParameters.setOAuthConsumerSecret(CONSUMER_SECRET);
    oAuthParameters.setOAuthToken(userToken.getSessionToken());

    try {
      signer = new OAuthRsaSha1Signer(getPrivateKey());
View Full Code Here

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

     * Creates an {@link OAuthHelper} configured with either an
     * {@link OAuthHmacSha1Signer} or an {@link OAuthRsaSha1Signer}, depending
     * on this endpoint's properties.
     */
    OAuthHelper newOAuthHelper() throws Exception {
        OAuthSigner signer = null;
        if (getKeyLoader() == null) {
            signer = new OAuthHmacSha1Signer();
        } else {
            signer = new OAuthRsaSha1Signer(getPrivateKey());
        }
View Full Code Here

    // your private key as a Base-64 string conforming to the PKCS #8 standard.
    // Visit http://code.google.com/apis/gdata/authsub.html#Registered to learn
    // more about creating a key/certificate pair.  If you are using HMAC-SHA1,
    // you must set your OAuth Consumer Secret, which can be obtained at
    // https://www.google.com/accounts/ManageDomains.
    OAuthSigner signer;
    switch (variables.getSignatureMethod()) {
      case RSA:
        signer = new OAuthRsaSha1Signer(variables.getSignatureKey());
        break;
      case HMAC:
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

     * Creates an {@link OAuthHelper} configured with either an
     * {@link OAuthHmacSha1Signer} or an {@link OAuthRsaSha1Signer}, depending
     * on this endpoint's properties.
     */
    OAuthHelper newOAuthHelper() throws Exception {
        OAuthSigner signer = null;
        if (getKeyLoader() == null) {
            signer = new OAuthHmacSha1Signer();
        } else {
            signer = new OAuthRsaSha1Signer(getPrivateKey());
        }
View Full Code Here

    // your private key as a Base-64 string conforming to the PKCS #8 standard.
    // Visit http://code.google.com/apis/gdata/authsub.html#Registered to learn
    // more about creating a key/certificate pair.  If you are using HMAC-SHA1,
    // you must set your OAuth Consumer Secret, which can be obtained at
    // https://www.google.com/accounts/ManageDomains.
    OAuthSigner signer;
    switch (variables.getSignatureMethod()) {
      case RSA:
        signer = new OAuthRsaSha1Signer(variables.getSignatureKey());
        break;
      case HMAC:
View Full Code Here

TOP

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

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.