liaolzy / oauth

Automatically exported from code.google.com/p/oauth
0 stars 0 forks source link

Empty string for accessor.accessToken causes problem #197

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Pass "" for accessor.accessToken

What is the expected output? What do you see instead?
Empty string causes an error instead of setting the variable to null.

What version of the product are you using? On what operating system?
Latest out of SVN as of the filing date of this issue

Sorry didn't spend much time looking into this myself, but I want to make sure 
it gets upstream.

Patch credited to Adam Zell attached

Original issue reported on code.google.com by lev...@gmail.com on 5 Apr 2011 at 9:38

Attachments:

GoogleCodeExporter commented 8 years ago
The UI default for the oauth token is an empty string, which according to the 
documentation means that no oauth_token will be generated.

However, the underlying OAuthMessage implementation interprets the empty string 
as a valid value and generates oauth_token.  This contributes to the OAuth 
signature, and will fail if the server does not expect oauth_token.

Setting the accessToken to null informs OAuthMessage to skip the oauth_token 
entirely.

Original comment by zells...@gmail.com on 5 Apr 2011 at 11:14