private String computeAuthorizationHeader(@NotNull final String requestMethod,@NotNull final String requestUrl,@NotNull final Map<String,String> requestParameters,@NotNull final String token,@NotNull final String tokenSecret){
  final OAuthHmacSigner signer=new OAuthHmacSigner();
  signer.clientSharedSecret=clientSecret;
  signer.tokenSharedSecret=tokenSecret;
  final OAuthParameters oauthParameters=new OAuthParameters();
  oauthParameters.consumerKey=clientId;
  oauthParameters.signer=signer;
  oauthParameters.token=token;
  oauthParameters.version="1.0";
  oauthParameters.computeNonce();
  oauthParameters.computeTimestamp();
  final GenericUrl genericRequestUrl=new GenericUrl(requestUrl);
  genericRequestUrl.putAll(requestParameters);
  try {
    oauthParameters.computeSignature(requestMethod,genericRequestUrl);
  }
 catch (  GeneralSecurityException e) {
    throw new RuntimeException(e);
  }
  return oauthParameters.getAuthorizationHeader();
}

private String computeAuthorizationHeader ( @ NotNull final String requestMethod , @ NotNull final String requestUrl , @ NotNull final Map < String , String > requestParameters , @ NotNull final String token , @ NotNull final String tokenSecret ) { final OAuthHmacSigner signer = new OAuthHmacSigner ( ) ; signer . clientSharedSecret = clientSecret ; signer . tokenSharedSecret = tokenSecret ; final OAuthParameters oauthParameters = new OAuthParameters ( ) ; oauthParameters . consumerKey = clientId ; oauthParameters . signer = signer ; oauthParameters . token = token ; oauthParameters . version = "1.0" ; oauthParameters . computeNonce ( ) ; oauthParameters . computeTimestamp ( ) ; final GenericUrl genericRequestUrl = new GenericUrl ( requestUrl ) ; genericRequestUrl . putAll ( requestParameters ) ; try { oauthParameters . computeSignature ( requestMethod , genericRequestUrl ) ; } catch ( GeneralSecurityException e ) { throw new RuntimeException ( e ) ; } return oauthParameters . getAuthorizationHeader ( ) ; }
compute the authorization header to sign the oauth 1 request .
