Package weibo4j.http

Examples of weibo4j.http.AccessToken


  return authToken;
  }

  public AuthToken exchangeToken(String oauth_verifier) throws Exception {

  AccessToken accessToken = weibo.getOAuthAccessToken(this.authToken.getToken(), this.authToken.getTokenSecret(), oauth_verifier);

  log.info("new_oauth_token ---> " + accessToken.getToken());
  log.info("new_oauth_token_secret ---> " + accessToken.getTokenSecret());
  log.info("user_id ---> " + accessToken.getUserId());
  log.info("screenName ---> " + accessToken.getScreenName());

  authToken.setUserName(Long.toString(accessToken.getUserId()));
  authToken.setToken(accessToken.getToken());
  authToken.setTokenSecret(accessToken.getTokenSecret());

  return authToken;

  }
View Full Code Here


  }

  /*----------------------------Oauth接口--------------------------------------*/

  public AccessToken getAccessTokenByCode(String code) throws WeiboException {
    return new AccessToken(client.post(WeiboConfig.getValue("accessTokenURL"), new PostParameter[] {
        new PostParameter("client_id", WeiboConfig.getValue("client_ID")),
        new PostParameter("client_secret", WeiboConfig.getValue("client_SERCRET")),
        new PostParameter("grant_type", "authorization_code"), new PostParameter("code", code),
        new PostParameter("redirect_uri", WeiboConfig.getValue("redirect_URI"))}, false));
  }
View Full Code Here

TOP

Related Classes of weibo4j.http.AccessToken

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.