daviddesberg / PHPoAuthLib

PHP 5.3+ oAuth 1/2 Client Library
Other
1.09k stars 454 forks source link

Failed to request resource #337

Open sayakb opened 9 years ago

sayakb commented 9 years ago

My application (Sticky Notes) uses your library with Google accounts. I have been successfully able to use oAuth on my workstations, however, some users are getting the following exception when they authorize the login request on Google: https://github.com/sayakb/sticky-notes/issues/183#issuecomment-66945362

Here is my code: https://github.com/sayakb/sticky-notes/blob/master/app/lib/auth/StickyNotesOAuthUserProvider.php

What am I doing wrong?

tessus commented 9 years ago

any update on this?

logical-and commented 9 years ago

Hi there @sayakb, @tessus. Can you please make proof-script, so I can just run it and get an error occured. If you will have done then I try to solve your issue.

plmarcelo commented 9 years ago

No way to get twitter working. Google and FB works like charm, but with twitter no way. All the time same error:

Fatal error: Uncaught exception 'OAuth\Common\Http\Exception\TokenResponseException' with message ' in /var/www/oauth/src/OAuth/Common/Http/Client/StreamClient.php on line 70

( ! ) OAuth\Common\Http\Exception\TokenResponseException: file_get_contents(https://api.twitter.com/oauth/request_token): failed to open stream: HTTP request failed! HTTP/1.1 401 Authorization Required in /var/www/oauth/src/OAuth/Common/Http/Client/StreamClient.php on line 70

Testing with examples. Any idea?

Thanks in advance

logical-and commented 9 years ago

@plmarcelo, here is updated library. Try it out and let me know if any issue will happen.

img

plmarcelo commented 9 years ago

Thanks a lot! @logical-and now it is already working. I also had to define the callback field on my application.

logical-and commented 9 years ago

@plmarcelo Ok, thank you. :) What did you mean by callback? What is the purpose for callback?

UserIgorG commented 8 years ago

@logical-and (по местоположению в профиле, думаю, по-русски можно спросить) В example-ах $serviceFactory не инициализирован перед вызовом createService. Если я пробую сделать $serviceFactory = new \OAuth\ServiceFactory(); то вываливает ошибку Fatal error: Class 'Buzz\Browser' not found in /path/OAuth/HTTPTransporterFactory.php on line 31

Что с этим можно сделать? Скачал какую-то Buzz библиотеку, но он её все-равно не видит.