public void signForAccessToken(HttpPost req) throws FiveHundredException { OAuthParameters params = new OAuthParameters(this.consumerKey); final ArrayList<NameValuePair> tuples = buildParameters(params); params.put(OAuthConstants.TOKEN, this.tokenKey); // generate the base string for signature. String str = getSignatureBaseString(req, params); str = getSignature(str, consumerSecret, this.tokenSecret); params.put(OAuthConstants.SIGNATURE, str); // get the authorization header str = params.getAuthorizationHeaderValue(); req.addHeader(OAuthConstants.HEADER, str); try { req.setEntity(new UrlEncodedFormEntity(tuples)); } catch (UnsupportedEncodingException e) { throw new FiveHundredException(e); } }