unfiltered/unfiltered — Issue #104: Issue: unfiltered.oauth , Auth parameters declared missing when trying to get a request token 
Author: jdevjram
Created: 2011-12-14 20:17:36+00:00
State: open

Here's what I did to reproduce the problem. I have the following unfiltered jetty config for 2-Legged OAuth :

```
// Server code:

stores = new OAuthStore { ... }
// isTokenServer is gotten from System.getProperty() . My flow is split into 2 servers.

if(isTokenServer) {
unfiltered.jetty.Http(8889)
.context("/oauth") {
// oauth dance
_.filter(OAuth(stores))
}.run
} else {
unfiltered.jetty.Http(8888)
.context("/api") {
//auth filter
_.filter(Protection(stores))
.filter(APIHandler)
}.run
}
```

I use python-oauth2 ( http://github.com/simplegeo/python-oauth2 ) as the oauth client and use httplib to make requests.

```
# Client Code :

import oauth2 as oauth
import httplib

CONSUMER_KEY = 'key'
CONSUMER_SECRET = 'secret'

consumer = oauth.Consumer(CONSUMER_KEY, CONSUMER_SECRET)

oauth_request = oauth.Request.from_consumer_and_token(consumer, http_url="http://localhost:8889/oauth/request_token", http_method = "POST", parameters={'oauth_callback' : 'http://localhost/ready'})

http_connection = httplib.HTTPConnection("%s:%d" % ("localhost", 8889))
http_connection.request("POST", "http://localhost:8889/oauth/request_token", headers=oauth_request.to_header())

response = http_connection.getresponse()
print " Request.to_header = " , oauth_request.to_header()
print "\nResponse = \'", response.read() , "\'"
```

```
Output:

Request.to_header = {'Authorization': u'OAuth realm="", oauth_body_hash="2jmj7l5rSw0yVb%2FvlWAYkK%2FYBwk%3D", oauth_nonce="33060004", oauth_timestamp="1323891366", oauth_consumer_key="key", oauth_signature_method="HMAC-SHA1", oauth_version="1.0", oauth_signature="WcB7i1T3GyZqJxFXbd62qwSt5pk%3D", oauth_callback="http%3A%2F%2Flocalhost%2Fready"'}

Response = ' oauth_consumer_key is required. oauth_signature_method is required. oauth_timestamp is required. oauth_nonce is required. oauth_callback is required. oauth_signature is required '
```

* Note that the callback URI is "localhost/ready" since the only "user" ( the resource provider ) has no user-agent and the client pings "/authorize" on the "user" 's behalf .
* The "user" is always logged in and is grants every consumer authorization request. There is no redirection required and the consumer simply gets the authorized request token and verifier from the response.