Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

requestRequestToken() has disappeared for Yahoo OAuth #164

Open
anthonyshay opened this issue Nov 5, 2015 · 9 comments
Open

requestRequestToken() has disappeared for Yahoo OAuth #164

anthonyshay opened this issue Nov 5, 2015 · 9 comments

Comments

@anthonyshay
Copy link

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

@ddaattttaa
Copy link

Hello, i have the same problem :(

Thank you a lot.

@hugohcn
Copy link

hugohcn commented Nov 28, 2015

The same problem here! :/

Did you guys solve the problem?

@FarhadMohammadi
Copy link

Hi I have the same problem,

Help me please

@webexpert4rv
Copy link

Hi , I'm having same issue ,

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

Thanks in advance .

@FarhadMohammadi
Copy link

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,
[email protected]

@anthonyshay
Copy link
Author

Could you please post your custom code here?

On Wednesday, June 15, 2016, MailerLaravelDeveloper <
[email protected]> 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,
[email protected]
javascript:_e(%7B%7D,'cvml','[email protected]');


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
.

@FarhadMohammadi
Copy link

FarhadMohammadi commented Jun 16, 2016

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

@philip
Copy link

philip commented Nov 9, 2017

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.

@ProMasoud
Copy link

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 );

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants