diff options
author | Ross Burton <ross@linux.intel.com> | 2009-05-21 20:50:40 +0100 |
---|---|---|
committer | Ross Burton <ross@linux.intel.com> | 2009-05-21 20:50:40 +0100 |
commit | 435c28a87a64e246194837ded991f0da3c2cfb1d (patch) | |
tree | 52fdc8a0cbd022ee1c148372f29f1e1402818d0b /examples | |
parent | e9a71922f5997243c45dfaaff21dd9b4a6340ca3 (diff) | |
download | librest-435c28a87a64e246194837ded991f0da3c2cfb1d.tar.gz |
Fix test-oauth to work with the new API
Diffstat (limited to 'examples')
-rw-r--r-- | examples/test-oauth.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/examples/test-oauth.c b/examples/test-oauth.c index 1d56d28..7022f69 100644 --- a/examples/test-oauth.c +++ b/examples/test-oauth.c @@ -40,10 +40,11 @@ main (int argc, char **argv) /* Consumer Secret */ "t4FM7LiUeD4RBwKSPa6ichKPDh5Jx4kt", /* FireEagle endpoint, which we bind as required */ - "https://fireeagle.yahooapis.com/%s", TRUE); + "https://fireeagle.yahooapis.com/", FALSE); /* First stage authentication, this gets a request token */ - oauth_proxy_auth_step (OAUTH_PROXY (proxy), "oauth/request_token", NULL); + if (!oauth_proxy_auth_step (OAUTH_PROXY (proxy), "oauth/request_token", &error)) + g_error ("Cannot request token: %s", error->message); /* From the token construct a URL for the user to visit */ g_print ("Go to https://fireeagle.yahoo.net/oauth/authorize?oauth_token=%s then hit any key\n", @@ -51,14 +52,15 @@ main (int argc, char **argv) getchar (); /* Second stage authentication, this gets an access token */ - oauth_proxy_auth_step (OAUTH_PROXY (proxy), "oauth/access_token", NULL); + if (!oauth_proxy_auth_step (OAUTH_PROXY (proxy), "oauth/access_token", &error)) + g_error ("Cannot request token: %s", error->message); /* We're now authenticated */ g_print ("Got access token\n"); /* Get the user's current location */ - rest_proxy_bind (proxy, "api/0.1/user"); call = rest_proxy_new_call (proxy); + rest_proxy_call_set_function (call, "api/0.1/user"); if (!rest_proxy_call_run (call, NULL, &error)) g_error ("Cannot make call: %s", error->message); |