Package net.oauth

Examples of net.oauth.OAuthAccessor


      // Used for unregistered oauth
      return new Token("", "");
    }

    OAuthClient httpClient = getOAuthClient();
    OAuthAccessor accessor =
      new OAuthAccessor(getOAuthConsumer(client, provider));

    Set<Map.Entry<String,String>> extraParams = null;
    if (provider.requestTokenParams != null) {
      extraParams = provider.requestTokenParams.entrySet();
    }
View Full Code Here


  }

  public static Token getAccessToken(OpenSocialClient client,
      OpenSocialProvider provider, Token requestToken) throws OAuthException,
      IOException, URISyntaxException {
    OAuthAccessor accessor =
      new OAuthAccessor(getOAuthConsumer(client, provider));
    accessor.accessToken = requestToken.token;
    accessor.tokenSecret = requestToken.secret;

    OAuthClient httpClient = getOAuthClient();
    OAuthMessage message = httpClient.invoke(accessor, "GET",
View Full Code Here

    helper.requestUxIcon(true);

    if (YES_STRING.equals(req.getParameter("oauth"))) {
      try {
        OAuthAccessor accessor = providerStore.getOAuthAccessor("google");
        helper.requestOauthAuthorization(accessor.consumer.consumerKey,
            "http://www.google.com/m8/feeds/");
      } catch (ProviderInfoNotFoundException e) {
        log("could not find provider info for Google", e);
        // we'll just ignore the OAuth request and proceed without it.
View Full Code Here

  private String getOAuthExtensionParameters(String consumer) {

    // make sure that the data in the configuration file is actually for
    // this RP.
    OAuthAccessor accessor;
    try {
      accessor = providerStore.getOAuthAccessor("google");
    } catch (ProviderInfoNotFoundException e) {
      return "";
    }
View Full Code Here

          "(state owner=" + stateOwner + ", pageViewer=" + pageViewer + ')');
    }
  }

  private void fetchRequestToken() throws OAuthRequestException, OAuthProtocolException {
    OAuthAccessor accessor = accessorInfo.getAccessor();
    HttpRequest request = createRequestTokenRequest(accessor);
   
    List<Parameter> requestTokenParams = Lists.newArrayList();
   
    addCallback(requestTokenParams);
View Full Code Here

  /**
   * Builds the data we'll cache on the client while we wait for approval.
   */
  private void buildClientApprovalState() {
    OAuthAccessor accessor = accessorInfo.getAccessor();
    responseParams.getNewClientState().setRequestToken(accessor.requestToken);
    responseParams.getNewClientState().setRequestTokenSecret(accessor.tokenSecret);
    responseParams.getNewClientState().setOwner(realRequest.getSecurityToken().getOwnerId());
  }
View Full Code Here

  /**
   * Builds the URL the client needs to visit to approve access.
   */
  private void buildAznUrl() throws OAuthRequestException {
    // We add the token, gadget is responsible for the callback URL.
    OAuthAccessor accessor = accessorInfo.getAccessor();
    if (accessor.consumer.serviceProvider.userAuthorizationURL == null) {
      throw responseParams.oauthRequestException(OAuthError.BAD_OAUTH_CONFIGURATION,
          "No authorization URL specified");
    }
    StringBuilder azn = new StringBuilder(
View Full Code Here

      // session extension per
      // http://oauth.googlecode.com/svn/spec/ext/session/1.0/drafts/1/spec.html
      accessorInfo.getAccessor().requestToken = accessorInfo.getAccessor().accessToken;
      accessorInfo.getAccessor().accessToken = null;
    }
    OAuthAccessor accessor = accessorInfo.getAccessor();
    if (accessor.consumer.serviceProvider.accessTokenURL == null) {
      throw responseParams.oauthRequestException(OAuthError.BAD_OAUTH_CONFIGURATION,
          "No access token URL specified.");
    }
    Uri accessTokenUri = Uri.parse(accessor.consumer.serviceProvider.accessTokenURL);
View Full Code Here

  /**
   * Save off our new token and secret to the persistent store.
   */
  private void saveAccessToken() throws OAuthRequestException {
    OAuthAccessor accessor = accessorInfo.getAccessor();
    TokenInfo tokenInfo = new TokenInfo(accessor.accessToken, accessor.tokenSecret,
        accessorInfo.getSessionHandle(), accessorInfo.getTokenExpireMillis());
    fetcherConfig.getTokenStore().storeTokenKeyAndSecret(realRequest.getSecurityToken(),
        accessorInfo.getConsumer(), realRequest.getOAuthArguments(), tokenInfo, responseParams);
  }
View Full Code Here

  /**
   * Builds the data we'll cache on the client while we make requests.
   */
  private void buildClientAccessState() {
    OAuthAccessor accessor = accessorInfo.getAccessor();
    responseParams.getNewClientState().setAccessToken(accessor.accessToken);
    responseParams.getNewClientState().setAccessTokenSecret(accessor.tokenSecret);
    responseParams.getNewClientState().setOwner(realRequest.getSecurityToken().getOwnerId());
    responseParams.getNewClientState().setSessionHandle(accessorInfo.getSessionHandle());
    responseParams.getNewClientState().setTokenExpireMillis(accessorInfo.getTokenExpireMillis());
View Full Code Here

TOP

Related Classes of net.oauth.OAuthAccessor

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.