Using oauth with a pre-obtained access token

Skip to first unread message

adam klein

Sep 11, 2011, 4:21:38 AM9/11/11
to OAuth Ruby
I'm using omniauth with google openid hybrid solution on my
application, and I'm able to retrieve the final access token + secret
for the user.
I've tried to sign the requests to google myself, but I was
unsuccessful (received a 403, "modification only allowed with api
So I tried to use oauth, but I received the same error.
(In both ways, getting public data was successful, but posting new
data returned the error)

On the google oauth playground I've successfuly posted the data

Am I using oauth well? Here is what my code looks like:

@consumer ='', 'IGl...', :site =>

uri = URI.parse(base_url)
https = https_for(uri)
request =

request["Content-Type"] = "application/atom+xml"
request.body = "<entry xmlns='
Atom' "+
" xmlns:media='
mrss/' "+

oauth_params = {:consumer => @consumer, :token => access_token}
oauth_helper =,
oauth_params.merge(:request_uri => uri))
request.headers.merge!({"Authorization" => oauth_helper.header})

response = https.request(request)

Adam Klein
Reply all
Reply to author
Message has been deleted
0 new messages