[twitter-dev] Re: I can't get update status using xAuth to work :(

2010-05-12 Thread @sebagomez
GOT IT!

Thanks!

On May 12, 10:40 am, Cameron Kaiser  wrote:
> > Hello Cameron, thanks for your tips.
> > I fixed my signature base string (concatening string suck!). You were
> > also right about the return message, I get a "Incorrect signature".
>
> > I have a couple of questions... why do you say my status is not
> > encoded correctly? it workrd for every other string I have to encode
> > (url, consumer key, etc)
> > What should I write in the request's body? I'm adding "status= > status>" all that encoded in the same way I did before...
>
> > Is there a problem with that?
>
> Here's what should be happening. Let's take "madam, I'm Adam" as our example.
>
> For your POST body, it is URL-encoded (and you do pass this as your POST):
>
>         status=madam%2C%20I%27m%20Adam
>
> For your sig base, however, it needs to be URL-encoded a *second time*:
>
>         status%3Dmadam%252C%2520I%2527m%2520Adam
>
> and you add that into your sig-base.
>
> Obviously both times the encoding is done according to the OAuth rules.
>
> What you had originally
>
>         status%3Dtest%3A%2012-May-10%2009%3A28%3A56
>
> does not look like you properly encoded it the second time for the sig base.
>
> --
>  personal:http://www.cameronkaiser.com/--
>   Cameron Kaiser * Floodgap Systems *www.floodgap.com* ckai...@floodgap.com
> -- Jesus loves you, and I'm trying to. -- Jack Thompson 
> ---


Re: [twitter-dev] Re: I can't get update status using xAuth to work :(

2010-05-12 Thread Cameron Kaiser
> Hello Cameron, thanks for your tips.
> I fixed my signature base string (concatening string suck!). You were
> also right about the return message, I get a "Incorrect signature".
> 
> I have a couple of questions... why do you say my status is not
> encoded correctly? it workrd for every other string I have to encode
> (url, consumer key, etc)
> What should I write in the request's body? I'm adding "status= status>" all that encoded in the same way I did before...
> 
> Is there a problem with that?

Here's what should be happening. Let's take "madam, I'm Adam" as our example.

For your POST body, it is URL-encoded (and you do pass this as your POST):

status=madam%2C%20I%27m%20Adam

For your sig base, however, it needs to be URL-encoded a *second time*:

status%3Dmadam%252C%2520I%2527m%2520Adam

and you add that into your sig-base.

Obviously both times the encoding is done according to the OAuth rules.

What you had originally

status%3Dtest%3A%2012-May-10%2009%3A28%3A56

does not look like you properly encoded it the second time for the sig base.

-- 
 personal: http://www.cameronkaiser.com/ --
  Cameron Kaiser * Floodgap Systems * www.floodgap.com * ckai...@floodgap.com
-- Jesus loves you, and I'm trying to. -- Jack Thompson ---


[twitter-dev] Re: I can't get update status using xAuth to work :(

2010-05-12 Thread @sebagomez
Hello Cameron, thanks for your tips.
I fixed my signature base string (concatening string suck!). You were
also right about the return message, I get a "Incorrect signature".

I have a couple of questions... why do you say my status is not
encoded correctly? it workrd for every other string I have to encode
(url, consumer key, etc)
What should I write in the request's body? I'm adding "status=" all that encoded in the same way I did before...

Is there a problem with that?

Thanks for you help

On May 12, 9:57 am, Cameron Kaiser  wrote:
> > I have the access_token with no problem, so now I have my oauth_token
> > and my oauth_token_secret, but every time I want to update my status I
> > get a 401... what am I doing wrong?
>
> > Here's my signature base string:
> > POST&http%3A%2F%2Fapi.twitter.com%2F1%2Fstatuses%2Fupdate.xml
> > &oauth_consumer_key%3DCONSUMER_KEY%26oauth_nonce%3Df897b67a-fb03-42fe-
> > aa97-aec348f32f9c%26oauth_signature_method%3DHMAC-
> > SHA1%26oauth_timestamp%3D1273667336%26oauth_token%3DOAUTH_TOKEN
> > %26oauth_version%3D1.0%26status%3Dtest%3A%2012-May-10%2009%3A28%3A56
>
> > and here's my Authorization header:
> > OAuth oauth_nonce="f897b67a-fb03-42fe-aa97-aec348f32f9c",
> > oauth_signature_method="HMAC-SHA1", oauth_timestamp="1273667336",
> > oauth_consumer_key="CONSUMER_KEY", oauth_token"=OAUTH_TOKEN",
> > oauth_signature="PlvMUChsc4ftZCjxL8oaTQnGhbQ%3D", oauth_version="1.0"
>
> The return message should list what the problem is (Invalid nonce, Invalid
> signature, etc.). However, I do see a couple things:
>
> - probably a typo: oauth_token"= should be oauth_token="
>
> - your status in your sig base does not look like it is encoded correctly.
>   It should be
>
> ...%26status%3Dtest%253A%252012-May-10%252009%253A28%253A56
>
> (done by eye)
>
> --
>  personal:http://www.cameronkaiser.com/--
>   Cameron Kaiser * Floodgap Systems *www.floodgap.com* ckai...@floodgap.com
> -- A penny saved is stupid. 
>  Hide quoted text -
>
> - Show quoted text -