Permalink
Browse files

Fixing Identi.ca's OAuth request_token URI

Revision "a" of OAuth 1.0 mandates the presence of "oauth_callback"
parameter.

Usually libraries appends an "oob" (Out of Band) oauth_callback if you
don't provide a valid callback url, and don't specify that you don't
want "OAuth 1.0a".

But apparently our library of choice for OAuth (liboauth) does not do
this, though the code is in library but commented out.

src/oauth.c:675-680 (as in HEAD, and 0.9.0 tarball):

675 #if 0 // oauth_version 1.0 Rev A
676   if (!oauth_param_exists(argv,argc,"oauth_callback")) {
677     snprintf(oarg, 1024, "oauth_callback=oob");
678     oauth_add_param_to_array(argcp, argvp, oarg);
679   }
680 #endif

So for now, we have to add this to our request_token URI.
  • Loading branch information...
1 parent 0120302 commit 635748da8dc67601f0669d55f2b0e1c1cbb82f68 @amir amir committed with Nov 7, 2010
Showing with 2 additions and 2 deletions.
  1. +2 −2 bti.c
View
4 bti.c
@@ -307,7 +307,7 @@ static const char identica_name[] = "identi.ca";
static const char twitter_request_token_uri[] = "http://twitter.com/oauth/request_token";
static const char twitter_access_token_uri[] = "http://twitter.com/oauth/access_token";
static const char twitter_authorize_uri[] = "http://twitter.com/oauth/authorize?oauth_token=";
-static const char identica_request_token_uri[] = "http://identi.ca/api/oauth/request_token";
+static const char identica_request_token_uri[] = "http://identi.ca/api/oauth/request_token?oauth_callback=oob";
static const char identica_access_token_uri[] = "http://identi.ca/api/oauth/access_token";
static const char identica_authorize_uri[] = "http://identi.ca/api/oauth/authorize?oauth_token=";
@@ -490,7 +490,7 @@ static int request_access_token(struct session *session)
{
char *post_params = NULL;
char *request_url = NULL;
- char *reply = NULL;
+ char *reply = NULL;
char *at_key = NULL;
char *at_secret = NULL;
char *verifier = NULL;

0 comments on commit 635748d

Please sign in to comment.