Signing Issues with various frameworks - XeroAPI/Xero-Net GitHub Wiki

We had several people experiencing issues with "invalid signature". We tried to reproduce the issue but without success.

Yesterday we had a break through. One of our developers was getting intermittent failure. It turned out to be be queries which had '(' or ')' in them. We sit next to other so we did some pair development and tracked it down. His code would always fail and mine would always pass. We were getting different signature base strings. Odd.

I use Visual Studio 2013 and he uses 2012. We bother have the 4.5.1 CLR installed and our code is compiled against 4.0.

We found this and went from there.

He was getting the behavior from 4.0 and I was getting the 4.5. So why was our server expecting the 4.5 behavior? Turns out the OAuth library on the server does it's own encoding and does not use the Uri stuff. It gives the 4.5 behavior.

To reproduce it I took a fresh Windows 8 VM and installed Xamarin Studio. This would rule out Visual Studio versions. The test failed and we had the same behavior as 4.0. To 'fix' the issue we used the code from the Xero fork of DevDefined to do the encoding. This gives the 4.5 behavior on all versions of CLR.

So thanks for the patience and sorry this took so long to track down.