public String buildAuthorizationHeaderValue(HttpMethod method, URI targetUrl, Map<String, String> oauthParameters, MultiValueMap<String, String> additionalParameters, String consumerSecret, String tokenSecret) {
		StringBuilder header = new StringBuilder();
		header.append("OAuth ");
		for (Entry<String, String> entry : oauthParameters.entrySet()) {
			header.append(oauthEncode(entry.getKey())).append("=\"").append(oauthEncode(entry.getValue())).append("\", ");
		}
		MultiValueMap<String, String> collectedParameters = new LinkedMultiValueMap<String, String>((int) ((oauthParameters.size() + additionalParameters.size()) / .75 + 1));
		collectedParameters.setAll(oauthParameters);
		collectedParameters.putAll(additionalParameters);		
		String baseString = buildBaseString(method, getBaseStringUri(targetUrl), collectedParameters);
		String signature = calculateSignature(baseString, consumerSecret, tokenSecret);
		header.append(oauthEncode("oauth_signature")).append("=\"").append(oauthEncode(signature)).append("\"");
		return header.toString();
	}
public String buildAuthorizationHeaderValue ( HttpMethod method , URI targetUrl , Map < String , String > oauthParameters , MultiValueMap < String , String > additionalParameters , String consumerSecret , String tokenSecret ) { StringBuilder header = new StringBuilder ( ) ; header . append ( "OAuth " ) ; for ( Entry < String , String > entry : oauthParameters . entrySet ( ) ) { header . append ( oauthEncode ( entry . getKey ( ) ) ) . append ( "=\"" ) . append ( oauthEncode ( entry . getValue ( ) ) ) . append ( "\", " ) ; } MultiValueMap < String , String > collectedParameters = new LinkedMultiValueMap < String , String > ( ( int ) ( ( oauthParameters . size ( ) + additionalParameters . size ( ) ) / .75 + 1 ) ) ; collectedParameters . setAll ( oauthParameters ) ; collectedParameters . putAll ( additionalParameters ) ; String baseString = buildBaseString ( method , getBaseStringUri ( targetUrl ) , collectedParameters ) ; String signature = calculateSignature ( baseString , consumerSecret , tokenSecret ) ; header . append ( oauthEncode ( "oauth_signature" ) ) . append ( "=\"" ) . append ( oauthEncode ( signature ) ) . append ( "\"" ) ; return header . toString ( ) ; }
Builds the authorization header.
The elements in additionalParameters are expected to not be encoded.