Wednesday, May 6, 2009

This was created so that I could use Google's OAuth Playground to track down why my OAuth implementation wasn't working.

It was helpful in that could see that there was nothing wrong with how I generated the signature base string. I then hard-coded the timestamp and nonce from the playground and found that I was calculating the signature incorrectly.

So then, I hard-coded the remaining parameters, the consumer key and the consumer secret, and now I was generating the correct signature. I then removed all the hard-coded parameters and logged the consumer key and secret. The logs showed that the consumer secret was wrong, it was the consumer key. So I looked at all the calls to see if I could have possibly swapped the parameters or maybe inadvertently called an overloaded method with shifted parameters, but that wasn't the case. Plus, the actual consumer key had the correct value.

Finally, I got to the configuration file, and saw

<property name="consumerKey"><value>${consumer-key}</value></property>
<property name="consumerSecret"><value>${consumer-key}</value></property>


Just a stupid little mistake.

No comments:

Post a Comment