You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shindig.apache.org by Aleksey Perfilov <ap...@hi5.com> on 2008/09/30 01:07:03 UTC
Oauth question
Hi everyone,
I wanted to ask for advice on how to send signed requests with Oauth from
Java, I¹m a little confused by the code in shindig.
I have access to ContentFetcherFactory, which is initialized via Guice, and
I thought I¹d just call fetch on it, like I used to do with the
SigningFetcher, however, the fetch creates a new OAuthFetcher which
requires the request to be passed in. Moreover, the request is already
expected to have OAuthArguments on it.
I thought that OAuthFetcher is there to put those arguments on the request,
similarly to SignedFetcher.
public OAuthFetcher(
OAuthFetcherConfig fetcherConfig,
HttpFetcher nextFetcher,
HttpRequest request) {
super(nextFetcher);
this.fetcherConfig = fetcherConfig;
this.clientState = new OAuthClientState(
fetcherConfig.getStateCrypter(),
request.getOAuthArguments().getOrigClientState());
this.responseParams = new
OAuthResponseParams(fetcherConfig.getStateCrypter());
}
So how does this work then? How do I sign the request if the only thing I
got is the url and my private key (which I used to pass to
SignedFetcherFactory, but now it is getting injected into
OAuthFetcherFactory and OAuthFetcherConfig via Guice )
Thanks in advance,
Aleksey