Exemplo n.º 1
0
 /**
  * @param token request token
  * @param tokenSecret request token secret
  * @return access token
  * @throws WeiboException
  * @since Weibo4J 1.2.0
  */
 public AccessToken getOAuthAccessToken(String token, String tokenSecret) throws WeiboException {
   try {
     this.oauthToken = new OAuthToken(token, tokenSecret) {};
     this.oauthToken = new AccessToken(httpRequest(accessTokenURL, new PostParameter[0], true));
   } catch (WeiboException te) {
     throw new WeiboException(
         "The user has not given access to the account.", te, te.getStatusCode());
   }
   return (AccessToken) this.oauthToken;
 }
Exemplo n.º 2
0
 /**
  * @param token request token
  * @return access token
  * @throws WeiboException
  * @since Weibo4J 1.2.0
  */
 public AccessToken getOAuthAccessToken(RequestToken token, String pin) throws WeiboException {
   try {
     this.oauthToken = token;
     this.oauthToken =
         new AccessToken(
             httpRequest(
                 accessTokenURL,
                 new PostParameter[] {new PostParameter("oauth_verifier", pin)},
                 true));
   } catch (WeiboException te) {
     throw new WeiboException(
         "The user has not given access to the account.", te, te.getStatusCode());
   }
   return (AccessToken) this.oauthToken;
 }