artdarek / oauth-4-laravel

OAuth Service Provider for Laravel 4

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

requestRequestToken() has disappeared for Yahoo OAuth

anthonyshay opened this issue · comments

commented

I've been using OAuth for a long time, and recently there's been a problem with Yahoo OAuth, I'm getting Call to undefined method OAuth\OAuth2\Service\Yahoo::requestRequestToken()

I'm using the exact code that is in the example:

// if code is provided get user data and sign in
if ( !empty( $token ) && !empty( $verify ) ) {
            // This was a callback request from yahoo, get the token
            $token = $yh->requestAccessToken( $token, $verify );
            $xid = array($token->getExtraParams());
            $result = json_decode( $yh->request( 'https://social.yahooapis.com/v1/user/'.$xid[0]['xoauth_yahoo_guid'].'/profile?format=json' ), true ); 

            dd($result);                                
}
// if not ask for permission first
else {
    // get request token
    $reqToken = $yh->requestRequestToken();
    // get Authorization Uri sending the request token
    $url = $yh->getAuthorizationUri(array('oauth_token' => $reqToken->getRequestToken()));
    // return to yahoo login url
    return Redirect::to( (string)$url );
}

Can anyone help on this?

Thanks

Hello, i have the same problem :(

Thank you a lot.

The same problem here! :/

Did you guys solve the problem?

Hi I have the same problem,

Help me please

Hi , I'm having same issue ,

Is there any conflict b/w laravel/socialite and oriceon/oauth-5-laravel .

Thanks in advance .

Google or Yahoo service providres use OAUTH2 authenticatin, You should use newest packages or any kind of library for using this services or for Yahoo services I wrote some custom codes that works for laravel framework,

if any body need it i can send them,
mailer.laravel.developer@gmail.com

commented

Could you please post your custom code here?

On Wednesday, June 15, 2016, MailerLaravelDeveloper <
notifications@github.com> wrote:

Google or Yahoo service providres use OAUTH2 authenticatin, You should use
newest packages or any kind of library for using this services or for Yahoo
services I wrote some custom codes that works for laravel framework,

if any body need it i can send them,
mailer.laravel.developer@gmail.com
javascript:_e(%7B%7D,'cvml','mailer.laravel.developer@gmail.com');


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#164 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/ANHY5ziaNBOZaTw53lZEhQ147Lnea2p5ks5qMNvGgaJpZM4Gc_Xq
.

I wrote a class Yahoo.php in app/classes directory of laravel framework that read my yahoo contacts, of course this is customed to my project, you can change it if you want, And if you saw any bugs please report me :) :)

https://github.com/FarhadMohammadi/yahoo

You'r yahoo developer console configs should be correct with callback route that returned information from yahoo, for example for me

in yahoo developer console callback path is: http://domain/user/contacts/import/yahoo, that equal to route path in my route files

I hope that works

It appears this problem relates to OAuth1 versus OAuth2 as requestRequestToken() only applies to OAuth1. I only looked briefly (as I've moved on) but, for example, disabling OAuth2 in PHPoAuthLib allows this to work as requestRequestToken() is now defined. Perhaps someone else will offer a real solution.

This is a working answer in stackoverflow

Use this code:

$url = $yh->getAuthorizationUri();
return redirect((string)$url);

instead of this code:

// get request token
$reqToken = $yh->requestRequestToken();
// get Authorization Uri sending the request token
$url = $yh->getAuthorizationUri(array('oauth_token' => $reqToken->getRequestToken()));
// return to yahoo login url
return Redirect::to( (string)$url );