Cool.
So for anyone who encounters the same problem, the solution is:
// VIA normal HTTP GET parameters
public static Response serviceGET(String serviceUrl, ConsumerContext context, Endpoint ep,
Token token, HttpServletRequest request, HttpServletResponse response)
throws IOException
{
HttpConnector connector = context.getHttpConnector();
UrlEncodedParameterMap params = new UrlEncodedParameterMap(serviceUrl);
context.getNonceAndTimestamp().put(params, token.getCk());
params.put(Constants.OAUTH_CONSUMER_KEY, ep.getConsumerKey());
params.put(Constants.OAUTH_TOKEN, token.getKey());
params.put(Constants.OAUTH_SIGNATURE_METHOD, ep.getSignature().getMethod());
String sig = ep.getSignature().sign(ep.getConsumerSecret(), token.getSecret(),
Signature.getBase(params, "GET"));
params.put(Constants.OAUTH_SIGNATURE, sig);
return connector.doGET(params.toStringRFC3986(), (Map<?,?>)null);
}
// VIA HTTP GET but the oauth parameters are transported via the "Authorization" header.
// this does not work on yahoo ... a bug they need to fix.
/*public static Response serviceGET(String serviceUrl, ConsumerContext context, Endpoint ep,
Token token, HttpServletRequest request, HttpServletResponse response)
throws IOException
{
HttpConnector connector = context.getHttpConnector();
UrlEncodedParameterMap params = new UrlEncodedParameterMap(serviceUrl);
context.getNonceAndTimestamp().put(params, token.getCk());
Parameter authorization = new Parameter("Authorization",
HttpAuthTransport.getAuthHeaderValue(params, ep, token,
context.getNonceAndTimestamp(), ep.getSignature()));
return connector.doGET(params.getUrl(), authorization);
}*/
Cheers