Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Proper Oauth usage
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  8 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Jason Lowder  
View profile  
 More options Oct 8 2012, 12:15 am
From: Jason Lowder <jblow...@gmail.com>
Date: Sun, 7 Oct 2012 21:15:54 -0700 (PDT)
Local: Mon, Oct 8 2012 12:15 am
Subject: Proper Oauth usage

Hello,

I had recently written a C# Rest test for the NetFlix API (which works) and
just started to do the same in Java with Rest Assured.

I have the following code which returns an error "403 -  Forbidden" when
running it, yet I know my Oauth tokens, keys etc are valid because my .Net
app runs them just fine.

Is there something wrong with my usage here?

        RestAssured.baseURI = "http://api-public.netflix.com";
        RestAssured.port = 80;
        RestAssured.oauth(consumerKey, consumerSecret, accessToken,
secretToken);

        Response myResponse = given().param("term", "star
wars").get("catalog/titles/autocomplete");

Thanks,

Jason


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Johan Haleby  
View profile  
 More options Oct 8 2012, 2:28 am
From: Johan Haleby <johan.hal...@gmail.com>
Date: Mon, 8 Oct 2012 08:28:12 +0200
Local: Mon, Oct 8 2012 2:28 am
Subject: Re: [rest-assured] Proper Oauth usage

Hi,

Rest Assured is using the
signpost<http://code.google.com/p/oauth-signpost/> framework
under the hood and you need to have it in the classpath (see
here<https://code.google.com/p/rest-assured/wiki/Usage#OAuth>).
If I'm not misstaken signpost only support OAuth
1.0a<http://oauth.net/core/1.0a/>.
Could that be the reason?

Regards,
/Johan


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jason Lowder  
View profile  
 More options Oct 8 2012, 5:38 pm
From: Jason Lowder <jblow...@gmail.com>
Date: Mon, 8 Oct 2012 14:38:10 -0700 (PDT)
Local: Mon, Oct 8 2012 5:38 pm
Subject: Re: [rest-assured] Proper Oauth usage

Hi,

The Jar files are in my external library and part of the classpath.  From
what I can tell they are using OAuth 1.0.

Is there anything else to look at?

Thanks,

Jason


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jason Lowder  
View profile  
 More options Oct 8 2012, 6:45 pm
From: Jason Lowder <jblow...@gmail.com>
Date: Mon, 8 Oct 2012 15:45:32 -0700 (PDT)
Local: Mon, Oct 8 2012 6:45 pm
Subject: Re: [rest-assured] Proper Oauth usage

Ok so it appears this does not work:

RestAssured.oauth(consumerKey, consumerSecret, accessToken, secretToken);

But this does:

Response myResponse = given().auth().oauth(consumerKey, consumerSecret,
accessToken, secretToken).param("term", "star
wars").get("/catalog/titles/autocomplete");

Why is this?  

Next, I noticed the response came back with encoding=gzip, which it
normally doesn't.  In my .Net implementation it returns an XML response.
 The content-type is application/xml.  Is there a configuration I can set
to not request encoding?

Thanks,

Jason


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Johan Haleby  
View profile  
 More options Oct 9 2012, 2:20 am
From: Johan Haleby <johan.hal...@gmail.com>
Date: Tue, 9 Oct 2012 08:20:47 +0200
Local: Tues, Oct 9 2012 2:20 am
Subject: Re: [rest-assured] Proper Oauth usage

Hm there's no reason why RestAssured.oauth(consumerKey, consumerSecret,
accessToken, secretToken); shouldn't work. It must be a bug, I'll add it to
the issue tracker. I'm planning to make a new release soon and if you're up
for it a pull request would be great!

/Johan


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Johan Haleby  
View profile  
 More options Oct 9 2012, 2:25 am
From: Johan Haleby <johan.hal...@gmail.com>
Date: Tue, 9 Oct 2012 08:25:08 +0200
Local: Tues, Oct 9 2012 2:25 am
Subject: Re: [rest-assured] Proper Oauth usage

And as a work-around if the latter statement works you can create try to
create a filter
<https://code.google.com/p/rest-assured/wiki/Usage#Filters> that
you later can configure statically (RestAssured.filters ) so you don't have
to duplicate your code.

/Johan


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jason Lowder  
View profile  
 More options Oct 9 2012, 10:50 am
From: Jason Lowder <jblow...@gmail.com>
Date: Tue, 9 Oct 2012 07:50:30 -0700 (PDT)
Local: Tues, Oct 9 2012 10:50 am
Subject: Re: [rest-assured] Proper Oauth usage

Hi Johan,

I just entered the Java world a couple days ago so some of this open source
terminology is a bit confusing to me. :-)  How do I make a pull request?

Also, do you have any comment on the return content being gzip encrypted?
 Either I'm leaving something out of a header or otherwise that was
naturally included in .Net to prevent the encryption.  I didn't see
anything in the docs that lead me to what I might need to do.

Thanks again,

Jason


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Johan Haleby  
View profile  
 More options Oct 10 2012, 2:10 am
From: Johan Haleby <johan.hal...@gmail.com>
Date: Wed, 10 Oct 2012 08:10:03 +0200
Local: Wed, Oct 10 2012 2:10 am
Subject: Re: [rest-assured] Proper Oauth usage

Hi,

A pull request is for Github and is described
here<https://help.github.com/articles/using-pull-requests>:) I can't
answer why you get a gzip response in when defining oauth
statically. The reason may be that HTTP Builder always adds "gzip" to the
header. This is something that I want to make configurable (of course) but
I haven't had time to do so yet.. There's so much to do! :)

Regards,
/Johan


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »