Examples of OAuthAccessor


Examples of net.oauth.OAuthAccessor

      if (extra != null) {
        return makeOAuthProblemReport(OAuth.Problems.PARAMETER_REJECTED, extra,
            HttpResponse.SC_BAD_REQUEST);
      }
    }
    OAuthAccessor accessor = new OAuthAccessor(consumer);
    validateMessage(accessor, info, true);
    String requestToken = Crypto.getRandomString(16);
    String requestTokenSecret = Crypto.getRandomString(16);
    String callbackUrl = info.message.getParameter(OAuth.OAUTH_CALLBACK);
    tokenState.put(
View Full Code Here

Examples of net.oauth.OAuthAccessor

        return makeOAuthProblemReport(OAuth.Problems.PARAMETER_REJECTED,
            extra, HttpResponse.SC_BAD_REQUEST);
      }
    }

    OAuthAccessor accessor = new OAuthAccessor(oauthConsumer);
    accessor.requestToken = requestToken;
    accessor.tokenSecret = state.tokenSecret;
    validateMessage(accessor, info, true);

    if (state.getState() == State.APPROVED_UNCLAIMED) {
View Full Code Here

Examples of net.oauth.OAuthAccessor

      consumer = signedFetchConsumer;
    } else {
      return makeOAuthProblemReport(OAuth.Problems.PARAMETER_ABSENT,
          "oauth_consumer_key not found", HttpResponse.SC_BAD_REQUEST);
    }
    OAuthAccessor accessor = new OAuthAccessor(consumer);
    String responseBody = null;
    if (throttled) {
      return makeOAuthProblemReport(
          OAuth.Problems.CONSUMER_KEY_REFUSED, "exceeded quota", HttpResponse.SC_FORBIDDEN);
    }
View Full Code Here

Examples of net.oauth.OAuthAccessor

          "(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

Examples of net.oauth.OAuthAccessor

  /**
   * 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

Examples of net.oauth.OAuthAccessor

  /**
   * 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 new OAuthRequestException(OAuthError.BAD_OAUTH_TOKEN_URL,
          "authorization");
    }
    StringBuilder azn = new StringBuilder(
View Full Code Here

Examples of net.oauth.OAuthAccessor

      // 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 new OAuthRequestException(OAuthError.BAD_OAUTH_TOKEN_URL, "access token");
    }
    Uri accessTokenUri = Uri.parse(accessor.consumer.serviceProvider.accessTokenURL);
View Full Code Here

Examples of net.oauth.OAuthAccessor

  /**
   * 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

Examples of net.oauth.OAuthAccessor

  /**
   * 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

Examples of net.oauth.OAuthAccessor

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

  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
TOP
Copyright © 2018 www.massapi.com. 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.