java - Unknown authorization header - Error 401 -
i accessing google spreadsheet feeds using hmac-sh1 sign. code :
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, getting error :
oauth.requestservlet doget: null com.google.gdata.util.authenticationexception: ok unknown authorization header
unknown authorization header
error 401
at com.google.gdata.client.http.httpgdatarequest.handleerrorresponse(httpgdatarequest.java:600) @ com.google.gdata.client.http.googlegdatarequest.handleerrorresponse(googlegdatarequest.java:563) @ com.google.gdata.client.http.httpgdatarequest.checkresponse(httpgdatarequest.java:552) @ com.google.gdata.client.http.httpgdatarequest.execute(httpgdatarequest.java:530) @ com.google.gdata.client.http.googlegdatarequest.execute(googlegdatarequest.java:535) @ com.google.gdata.client.service.getfeed(service.java:1135) @ com.google.gdata.client.service.getfeed(service.java:998) @ com.google.gdata.client.googleservice.getfeed(googleservice.java:631) @ com.google.gdata.client.service.getfeed(service.java:1017) @ oauth.accessfeeds.access(accessfeeds.java:74)
what problem ?
i suspect server sending "401 unauthorized" response www-authenticate header client code doesn't recognize. may sending no www-authenticate header @ ... vide "null" in exception message.
(the latter violation of http 1.1 specification. 401 response required have www-authenticate header client uses decide how authenticate. refer spec details.)
so why might happening talking google feed? perhaps you've configured client wrong url? perhaps client trying connect via poorly designed proxy?
Comments
Post a Comment