I am accessing Google Spreadsheet feeds using HMAC-SH1 sign. My Code is : 

GoogleOAuthParameters oauthParameters = new GoogleOAuthParameters();
        oauthParameters.setOAuthConsumerKey(CONSUMER_KEY);
        oauthParameters.setOAuthConsumerSecret(CONSUMER_SECRET);
        oauthParameters.setScope("https://spreadsheets.google.com/feeds/";);
       
 oauthParameters.setOAuthType(OAuthParameters.OAuthType.THREE_LEGGED_OAUTH);
       
 
oauthParameters.setOAuthToken(request.getSession().getAttribute("oauth_token").toString());
       
 
oauthParameters.setOAuthTokenSecret(request.getSession().getAttribute("oauth_token_secret").toString());

GoogleService googleService = new GoogleService("wise", 
"searceapps-searcegadget2-1");
        googleService.setOAuthCredentials(oauthParameters, new 
OAuthHmacSha1Signer());
        URL feedUrl = new 
URL("https://spreadsheets.google.com/feeds/spreadsheets/private/full/";);
        
        SpreadsheetFeed resultFeed = googleService.getFeed(feedUrl, 
SpreadsheetFeed.class);

But, I am getting the error : 

Oauth.requestServlet doGet: null
com.google.gdata.util.AuthenticationException: OK
<HTML>
<HEAD>
<TITLE>Unknown authorization header</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
<H1>Unknown authorization header</H1>
<H2>Error 401</H2>
</BODY>
</HTML>

        at 
com.google.gdata.client.http.HttpGDataRequest.handleErrorResponse(HttpGDataRequest.java:600)
        at 
com.google.gdata.client.http.GoogleGDataRequest.handleErrorResponse(GoogleGDataRequest.java:563)
        at 
com.google.gdata.client.http.HttpGDataRequest.checkResponse(HttpGDataRequest.java:552)
        at 
com.google.gdata.client.http.HttpGDataRequest.execute(HttpGDataRequest.java:530)
        at 
com.google.gdata.client.http.GoogleGDataRequest.execute(GoogleGDataRequest.java:535)
        at com.google.gdata.client.Service.getFeed(Service.java:1135)
        at com.google.gdata.client.Service.getFeed(Service.java:998)
        at com.google.gdata.client.GoogleService.getFeed(GoogleService.java:631)
        at com.google.gdata.client.Service.getFeed(Service.java:1017)
        at Oauth.accessFeeds.access(accessFeeds.java:74)


What is the problem with this ?

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.

Reply via email to