createAuthorizationUrl? |
![]() ![]() |
createAuthorizationUrl? |
| Hyoungsoo |
Jul 14 2009, 10:19 PM
Post
#1
|
|
Group: Members Posts: 2 |
Hi,
I'm just trying out Y!OS PHP SDK, and I'm stuck with the very first example. In the example, http://developer.yahoo.com/oauth/guide/oauth-auth-flow.html, there is a reference to a method, YahooSession::createAuthorizationUrl(CONSUMER_KEY, CONSUMER_SECRET, $callback). But this does not work. (I'm including Yahoo.inc file with the correct include path.) In fact, according to the api doc, YahooSession class does not contain such a method. In another example, http://developer.yahoo.com/social/updates/demo.html, there is a line, YahooAuthentication::createAuthorizationUrl($this->createRequestToken(), $callbackUrl), which again does not work. Where is this class YahooAuthentication? I've been looking all over, but just couldn't find the answers. Is this because the docs are out-dated? Are these examples supposed to work? Are we supposed to use a different APIs for OAuth? Is anybody using Yahoo OAuth apps? ... Thanks in advance for any inputs/suggestions! ~Harry |
|
|
|
| Erik |
Jul 16 2009, 06:32 PM
Post
#2
|
|
Group: Yahoos Posts: 48 |
Hi, Hi Harry, Thanks for your thorough description of the problem. I'll look into it and post back. If there is a bug in the documentation's code, I'll file a request to fix it and provide you with the correct code. Many people use our OAuth APIs and it's very important to us that our documentation is helpful and any sample code in it works correctly. Thanks for taking time to bring this to our attention. Erik |
|
|
|
| Hyoungsoo |
Jul 17 2009, 01:16 AM
Post
#3
|
|
Group: Members Posts: 2 |
Hi Harry, Hi Erik, Thanks for following up. I made some progress since I posted the question. [1] YahooSession::createAuthorizationUrl() actually exists in the current version of Yahoo.inc, and I've verified it works. Thanks. [2] The api doc, http://developer.yahoo.com/social/php_api/annotated.html, seems to be a bit out-dated since this method is not listed, among other things. In fact, the doc says it was "Generated on Thu Nov 20 12:23:17 2008". [3] The second example I quoted is also out-dated (and possibly wrong). Apparently, the "private" class YahooAuthentication has been changed to YahooAuthorization, which is still marked as "@private" in the source. Thanks, ~Harry |
|
|
|
| Erik |
Jul 17 2009, 08:53 AM
Post
#4
|
|
Group: Yahoos Posts: 48 |
Hi Erik, [1] I'm glad you were able to find the YahooSession::createAuthorizationUrl() function and that it's working for you. [2] I agree that that section of the documentation is outdated. Where did you find the link to it? If the link is still in our docs, I'll file a request to remove it. [3] Thanks for digging into Yahoo.inc. Based on the version I'm using, I can replicate a few errors: - as you noted, "YahooAuthentication" should be "YahooAuthorization" in the RatingUtil::createAuthorizationUrl and RatingUtil::createRequestToken functions - the call to "YahooAuthentication::createRequestToken" should be "YahooAuthorization::getRequestToken" in RatingUtil::createRequestToken - if you are tracking all errors and warnings, php will throw an error about a missing third param in the call to YahooAuthorization::getRequestToken in RatingUtil::createRequestToken. This can be remedied by passing null as the third param, ie: $token = YahooAuthorization::getRequestToken($this->_consumer->key, $this->_consumer->secret, null); I'll review all the sample code from the tutorial in [3] and work to resolve any errors/omissions. Thanks again for bringing all this to our attention. I'm sorry for the confusion. Please post back if you find anything else, or have any further questions. Best regards, Erik |
|
|
|
| lucas |
Aug 13 2009, 10:13 PM
Post
#5
|
|
Group: Members Posts: 5 |
Hello, for me nothing is working with the php library found there : http://github.com/yahoo/yos-social-php/tree/master
I looked for downloading a tar.gz, but nothin, I just copy / paste the library . $yahoo_session = YahooSession::requireSession(API_KEY, SHARED_SECRET); don' works, why? I don't have any error message. |
|
|
|
| lucas |
Aug 13 2009, 11:34 PM
Post
#6
|
|
Group: Members Posts: 5 |
In fact I had an error message in /var/log/apache2/error.log
It was a dependency problem between CURL & SSL, so after installing ca-certificates, It works perfectly |
|
|
|
![]() ![]() |