401 errors are typically due to encoding/escaping
problems with the signature base string.

It may be that your key/secret/token is being double
encoded or not encoded at all.  As a starting point,
I would use the values returned by Blogger (as is).

Are you able to run that sample successfully?

Eric

On Jan 25, 7:12 pm, David Leangen <[email protected]> wrote:
> > On Fri, Jan 23, 2009 at 8:32 AM, Eric (Google) <[email protected]>wrote:
>
> >> The Google Data Java client libraru has an OAuth helper class.
>
> >> There's an example here:
>
> >>http://code.google.com/p/gdata-java-client/source/browse/trunk/java/s...
>
> Well, I followed the example, and as far as I can tell, I'm doing the same
> thing, the only difference being that I have my own OAuthService to which I
> save the user access token so I can use it again later as needed.
>
> Here is the code:
>
>         GoogleOAuthParameters oauthParameters = new GoogleOAuthParameters();
>         oauthParameters.setOAuthConsumerKey( myUnencodedConsumerKey );
>         oauthParameters.setOAuthConsumerSecret( myUnencodedConsumerSecret );
>         oauthParameters.setScope( "http://www.blogger.com/feeds/"; );
>         OAuthSigner signer = new OAuthHmacSha1Signer();
>         // Retrieve the unencoding token string
>         String token = oauthService.getToken();
>         oauthParameters.setOAuthToken( token );
>         bloggerService.setOAuthCredentials( oauthParameters, signer );
>         URL feedUrl = new URL( "http://www.blogger.com/feeds/default/blogs";
> );
>         Feed resultFeed = bloggerService.getFeed( feedUrl, BlogFeed.class );
>
> However, I get this error:
>
> <HTML>
> <HEAD>
> <TITLE>Unknown authorization header</TITLE>
> </HEAD>
> <BODY BGCOLOR="#FFFFFF" TEXT="#000000">
> <H1>Unknown authorization header</H1>
> <H2>Error 401</H2>
> </BODY>
> </HTML>
>
> I wonder what's missing...
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"OAuth" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [email protected]
For more options, visit this group at http://groups.google.com/group/oauth?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to