This project has moved and is read-only. For the latest updates, please go here.

Authorisation fails if status update contains certain characters: !'()*

Nov 5, 2012 at 9:02 PM

When calling UpdateStatus() with any of these five characters !'()* in the status text the update fails with "Could not authenticate you".

I noticed that these characters encode differently in the status in the query string and the post data (not sure why it's in two places anyway) so wondered if this had something to do with it.

I'm assuming the encoding and hashing are causing the authentication issue

Using, twitter api version 1.1

Note: There may be other characters as well but as I think it's due to url encoding I just tested this list: `!@#$%^&*()_-+=.~,:;'?/|\[]


Nov 5, 2012 at 9:28 PM

Been debugging and found my hunch was correct - but not 100% such why and it's getting late.

 BuildQueryString() uses Uri.EscapeDataString to encode unlike the other places  in the code that use BuildUrlHelper.UrlEncode

Changed both of these to use BuildUrlHelper.UrlEncode and it now works.


Nov 5, 2012 at 9:35 PM
Edited Nov 6, 2012 at 12:46 AM
Hi Tim,

Thanks, I appreciate that.

Nov 6, 2012 at 12:47 AM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.