|
qiang - 2013-05-27 07:37:25
Hello,Manuel Lemos.
Thanks for this great oauth package.
Recently, I want to integrate odesk api by using your amazing class.
I set some values according to your document, but after process() function,
access token is empty.(401 error occured).
it redirects me to odesk authorization page successfully and come back with oauth_verifier. It generates an error when obtaining access token.
Please check below and give me tips about what to do.
(Here i can't understand the role of the scope value.)
$client = new oauth_client_class;
$client->debug = true;
$client->debug_http = true;
$client->server = '';
$client->redirect_uri = 'http://'.$_SERVER['HTTP_HOST']. dirname(strtok($_SERVER['REQUEST_URI'],'?')).'/login_with_odesk.php';
$client->client_id = 'af80152e5fa61ad20af07e89db0XXXXX';
$client->client_secret = 'b0929aefeb7XXXXX';
$client->oauth_version = '1.0';
$client->request_token_url = 'https://www.odesk.com/api/auth/v1/oauth/token/request';
$client->access_token_url = 'https://www.odesk.com/api/auth/v1/oauth/token/access';
$client->dialog_url = 'https://www.odesk.com/services/api/auth';
$client->token_request_method = 'post';
$client->scope='';
Thanks for your time.
qiang.
Manuel Lemos - 2013-05-27 08:03:45 - In reply to message 1 from qiang
I never tried oDesk, so it would be useful if you could show the debug output.
qiang - 2013-05-27 08:40:07 - In reply to message 2 from Manuel Lemos
Hi, Thank you very much for
This is my debug result.
OAuth client result
It was not possible to authorize the application.
Authorization error: it was not possible to access the OAuth access token: it was returned an unexpected response status 401 Response: ‹+K-ÊLËL-RÈ,V(J-,Í,JM‡M j
this is the url of odesk api.
developers.odesk.com/w/page/3810654 ...
please help me.
Thanks.
qiang - 2013-05-27 11:56:10 - In reply to message 2 from Manuel Lemos
Hello,Manuel Lemos.
I posted my debug result.
I also posted odesk api documentation url.
I think there is no much difference between odesk and other sites like facebook.
What's the reason that i can't get access token.
With the use of your class, I got the oauth_verifier.
But access token can't be obtained.
Could you please explain me?
Thanks for your time.
qiang
Manuel Lemos - 2013-05-27 12:30:49 - In reply to message 3 from qiang
You just posted the error message. You need enable PHP error log and show what is appearing there.
Anyway, I suspect that the OAuth protocol version is 1.0a and not 1.0 .
qiang - 2013-05-27 12:43:28 - In reply to message 5 from Manuel Lemos
Hi
I changed version from 1.0 to 1.0a.
It magically worked.
But i wonder what 's the difference between 1.0 and 1.0a
And odesk api describes that they are implementing 1.0.
I really appreciate your efforts.
Thanks Manuel Lemos.
You're my saviour.
Is there anyway i can promote you and your class?
Best Regards.
Qiang
Manuel Lemos - 2013-05-27 12:54:41 - In reply to message 6 from qiang
I have seen that over and over again. OAuth 1.0a is a security fix of 1.0. Nobody should be using OAuth 1.0. Dropbox uses it though.
I suspect oDesk used OAuth 1.0 in the past and then moved on to 1.0a without updating the documentation.
That is just one of many annoyances of OAuth implementations that drives people crazy.
Anyway, I am glad it worked for you now. Feel free to tell other people that may need it to use the class and avoiding "banging your head against a wall" until you figure all the issues.
|