Receiving Response 417 when requesting OAuth Token


I have some code that was working on Friday, and now is not… I get the following response when I try to perform the OAuth ‘threeLegDance’ (I blanked out my key & secret info):

net.oauth.OAuthProblemException: HTTP/1.1 417 Expectation Failed
oauth_signature base string: POST&

HTTP request:
POST /oauth/request_token
Content-Type: application/x-www-form-urlencoded
Content-Length: 263

<<<<<<<< HTTP response:
HTTP/1.1 417 Expectation Failed
Date: Mon, 24 Oct 2011 15:18:03 GMT
Server: hi
Vary: Accept-Encoding
Content-Length: 364
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
Content-Type: text/html; charset=iso-8859-1

417 Expectation Failed

Expectation Failed

The expectation given in the Expect request-header field could not be met by this server.

The client sent

    Expect: 100-Continue
but we only allow the 100-continue expectation.

It appears from the message that the Expect request header has been changed to expect 100-continue where as the library I am using passes 100-Continue.

The code that is executed looks like the following:
OAuthClient client = new OAuthClient(new HttpClient4());
List parameters = new ArrayList();
parameters.add(new Parameter(OAConstants.OAUTH_CALLBACK, callback));
if(StringUtil.isNotEmpty(signatureMethod)) {
parameters.add(new Parameter(OAConstants.OAUTH_SIGNATURE_METHOD, signatureMethod));
client.getRequestToken(accessor, “POST”, parameters);

I am using a library from google to perform the OAuth requests:

This was working OK on Friday, but is not now. Any ideas?


Hm, have you tried modifying the library to pass the lowercase c? The spec says that the comparison should be case-insensitive, but I wouldn’t rule out an error in the server’s implementation. We sometimes change the HTTP server responding to requests, so that may explain your request succeeding on Friday but not today.