Package net.oauth.OAuth

Examples of net.oauth.OAuth.Parameter


        requestToken, new TokenState(requestTokenSecret, accessor.consumer, callbackUrl));
    List<Parameter> responseParams = OAuth.newList(
        "oauth_token", requestToken,
        "oauth_token_secret", requestTokenSecret);
    if (callbackUrl != null) {
      responseParams.add(new Parameter(OAuthConstants.OAUTH_CALLBACK_CONFIRMED, "true"));
    }
    return new HttpResponse(OAuth.formEncode(responseParams));
  }
View Full Code Here


      dest = nextFetcher;
    }
    if (trustedParams != null) {
      List<Parameter> trusted = Lists.newArrayList();
      for (Entry<String, String> e : trustedParams.entrySet()) {
        trusted.add(new Parameter(e.getKey(), e.getValue()));
      }
      return new OAuthRequest(fetcherConfig, dest, trusted);
    }
    return new OAuthRequest(fetcherConfig, dest);
  }
View Full Code Here

        requestToken, new TokenState(requestTokenSecret, callbackUrl));
    List<Parameter> responseParams = OAuth.newList(
        "oauth_token", requestToken,
        "oauth_token_secret", requestTokenSecret);
    if (callbackUrl != null) {
      responseParams.add(new Parameter(OAuth.OAUTH_CALLBACK_CONFIRMED, "true"));
    }
    return new HttpResponse(OAuth.formEncode(responseParams));
  }
View Full Code Here

                                                      requestMessage.getParameter(OAuth.OAUTH_VERSION), callback);

    List<Parameter> responseParams = OAuth.newList(OAuth.OAUTH_TOKEN, entry.getToken(),
                                                   OAuth.OAUTH_TOKEN_SECRET, entry.getTokenSecret());
    if (callback != null) {
      responseParams.add(new Parameter(OAuth.OAUTH_CALLBACK_CONFIRMED, "true"));
    }
    sendResponse(servletResponse, responseParams);
  }
View Full Code Here

      dest = nextFetcher;
    }
    if (trustedParams != null) {
      List<Parameter> trusted = Lists.newArrayList();
      for (Entry<String, String> e : trustedParams.entrySet()) {
        trusted.add(new Parameter(e.getKey(), e.getValue()));
      }
      return new OAuthRequest(fetcherConfig, dest, trusted);
    }
    return new OAuthRequest(fetcherConfig, dest);
  }
View Full Code Here

        requestToken, new TokenState(requestTokenSecret, callbackUrl));
    List<Parameter> responseParams = OAuth.newList(
        "oauth_token", requestToken,
        "oauth_token_secret", requestTokenSecret);
    if (callbackUrl != null) {
      responseParams.add(new Parameter(OAuth.OAUTH_CALLBACK_CONFIRMED, "true"));
    }
    return new HttpResponse(OAuth.formEncode(responseParams));
  }
View Full Code Here

    String baseCallback = StringUtils.trimToNull(accessorInfo.getConsumer().getCallbackUrl());
    if (baseCallback != null) {
      String callbackUrl = fetcherConfig.getOAuthCallbackGenerator().generateCallback(
          fetcherConfig, baseCallback, realRequest, responseParams);
      if (callbackUrl != null) {
        requestTokenParams.add(new Parameter(OAuth.OAUTH_CALLBACK, callbackUrl));
      }
    }
  }
View Full Code Here

      paramMap.put(param.getKey(), param.getValue());
    }

    authParams.clear();
    for (Entry<String, String> entry : paramMap.entrySet()) {
      authParams.add(new Parameter(entry.getKey(), entry.getValue()));
    }
  }
View Full Code Here

      return;
    }

    String owner = realRequest.getSecurityToken().getOwnerId();
    if (owner != null && realRequest.getOAuthArguments().getSignOwner()) {
      params.add(new Parameter(OPENSOCIAL_OWNERID, owner));
    }

    String viewer = realRequest.getSecurityToken().getViewerId();
    if (viewer != null && realRequest.getOAuthArguments().getSignViewer()) {
      params.add(new Parameter(OPENSOCIAL_VIEWERID, viewer));
    }

    String app = realRequest.getSecurityToken().getAppId();
    if (app != null) {
      params.add(new Parameter(OPENSOCIAL_APPID, app));
    }

    String appUrl = realRequest.getSecurityToken().getAppUrl();
    if (appUrl != null) {
      params.add(new Parameter(OPENSOCIAL_APPURL, appUrl));
    }

    if (realRequest.getOAuthArguments().isProxiedContentRequest()) {
      params.add(new Parameter(OPENSOCIAL_PROXIED_CONTENT, "1"));
    }
  }
View Full Code Here

   * Add signature type to the message.
   */
  private void addSignatureParams(List<Parameter> params) {
    if (accessorInfo.getConsumer().getConsumer().consumerKey == null) {
      params.add(
          new Parameter(OAuth.OAUTH_CONSUMER_KEY, realRequest.getSecurityToken().getDomain()));
    }
    if (accessorInfo.getConsumer().getKeyName() != null) {
      params.add(new Parameter(XOAUTH_PUBLIC_KEY_OLD, accessorInfo.getConsumer().getKeyName()));
      params.add(new Parameter(XOAUTH_PUBLIC_KEY_NEW, accessorInfo.getConsumer().getKeyName()));
    }
    params.add(new Parameter(OAuth.OAUTH_VERSION, OAuth.VERSION_1_0));
    params.add(new Parameter(OAuth.OAUTH_TIMESTAMP,
        Long.toString(fetcherConfig.getClock().currentTimeMillis() / 1000L)));
    // the oauth.net java code uses a clock to generate nonces, which causes nonce collisions
    // under heavy load.  A random nonce is more reliable.
    params.add(new Parameter(OAuth.OAUTH_NONCE, String.valueOf(Math.abs(Crypto.RAND.nextLong()))));
  }
View Full Code Here

TOP

Related Classes of net.oauth.OAuth.Parameter

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.