PHP Classes

Doesn't seem to be working on yahoo

Recommend this page to a friend!

      PHP OAuth Library  >  All threads  >  Doesn't seem to be working on yahoo  >  (Un) Subscribe thread alerts  
Subject:Doesn't seem to be working on yahoo
Summary:I get no data back
Messages:11
Author:Adrian Marriae
Date:2012-11-02 21:10:06
Update:2012-12-13 20:25:57
 
  1 - 10   11 - 11  

  1. Doesn't seem to be working on yahoo   Reply   Report abuse  
Picture of Adrian Marriae Adrian Marriae - 2012-11-02 21:10:06
Seems to half work on yahoo

The only result i get is

you have logged in successfully with Yahoo!

nothing else no data??

  2. Re: Doesn't seem to be working on yahoo   Reply   Report abuse  
Picture of Arno Buizer Arno Buizer - 2012-11-02 23:12:29 - In reply to message 1 from Adrian Marriae
I've implemented this package with Google,Twitter,Facebook working nice, but for Yahoo I also get no data, only the message "logged in succesfully", even if I am not logged in at all! (I understood the latter is kind of caching problem, but even with a new clean environment (chrome iso IE9 (or also for IE9 64 bit on the same computer). But worse of all, I get no userdata, so nothing to match with for the person who logged in.
I give this reply to confirm this behaviour is not an incident. (And I get this behaviour just with the given example code. (only filled in my apps credentials).

  3. Re: Doesn't seem to be working on yahoo   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2012-11-03 01:14:37 - In reply to message 1 from Adrian Marriae
Yahoo expires tokens after 1 hour. The latest version checks for expired tokens but you may be having some trouble with previously authorized tokens if the machine on which PHP is running is not set to the correct time.

It is always good to keep the machine time correct by synchronizing with an NTP server. Check it here for servers from where you can synchronize your machine time.

en.wikipedia.org/wiki/Network_Time_ ...

Also if authorization fails for some reason, there needs to be a check for the authorization_error variable.

If you still are not sure what to do, set the debug variable and copy the error log of your accesses so I can see what is going on. You may want to erase sensitive information from the logs first, like OAuth tokens and secrets, before publishing it here.

  4. Re: Doesn't seem to be working on yahoo   Reply   Report abuse  
Picture of brijendra singh brijendra singh - 2012-12-07 13:59:36 - In reply to message 3 from Manuel Lemos
While using the Yahoo i get the same issue.
below is the client class object:
oauth_client_class Object
(
[error] =>
[debug] => 1
[debug_http] => 1
[exit] =>
[debug_output] => OAuth client: Checking the OAuth token authorization state
OAuth client: The OAuth access token is not set
OAuth client: Requesting the unauthorized OAuth token
OAuth client: Accessing the OAuth request token at https://api.login.yahoo.com/oauth/v2/get_request_token
OAuth client: Could not retrieve the OAuth access. Error: it was not possible to access the OAuth request token: it was returned an unexpected response status 401 Response: oauth_problem=consumer_key_unknown

[debug_prefix] => OAuth client:
[server] => Yahoo
[request_token_url] => https://api.login.yahoo.com/oauth/v2/get_request_token
[dialog_url] => https://api.login.yahoo.com/oauth/v2/request_auth
[append_state_to_redirect_uri] =>
[access_token_url] => https://api.login.yahoo.com/oauth/v2/get_token
[oauth_version] => 1.0a
[url_parameters] =>
[authorization_header] =>
[redirect_uri] => http://staging.higherl.com/lms_clients/oauth_api/login_with_yahoo.php
[client_id] => uer433TIkY2zkph90Kawux5PMYwa5j9qLtN7Cpg-
[client_secret] => 6333570c4a3e09493801803b8d6db377
[scope] =>
[access_token] =>
[access_token_secret] =>
[access_token_expiry] =>
[access_token_type] =>
[access_token_error] => it was not possible to access the OAuth request token: it was returned an unexpected response status 401 Response: oauth_problem=consumer_key_unknown
[authorization_error] => it was not possible to access the OAuth request token: it was returned an unexpected response status 401 Response: oauth_problem=consumer_key_unknown
[response_status] => 401
[oauth_user_agent] => PHP-OAuth-API (http://www.phpclasses.org/oauth-api $Revision: 1.38 $)
[session_started] => 1
)

  5. Re: Doesn't seem to be working on yahoo   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2012-12-08 05:14:07 - In reply to message 4 from brijendra singh
The error message says consumer_key_unknown .

This seems to mean that you are using an incorrect consumer key set to the client_id class variable.

Did you create an application with Yahoo? Are you sure you are using the the correct consumer key provided by Yahoo?

  6. Re: Doesn't seem to be working on yahoo   Reply   Report abuse  
Picture of brijendra singh brijendra singh - 2012-12-11 14:13:56 - In reply to message 5 from Manuel Lemos
I am getting the response from yahoo. All the error variables are null but there is nothing i get in the $user object. User information is null.
Is there any setting on yahoo or is it something wrong with the api call?

  7. Re: Doesn't seem to be working on yahoo   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2012-12-11 19:17:00 - In reply to message 6 from brijendra singh
The API call does not return an error because the request was sent and the response was received, but the access_token_error variable was set to the error message returned by the API. It says:

it was not possible to access the OAuth request token: it was returned an unexpected response status 401 Response: oauth_problem=consumer_key_unknown

This seems to mean that the values that you set to either client_id or client_secret are wrong. You need to create an application with Yahoo and copy the right values they provide.

  8. Re: Doesn't seem to be working on yahoo   Reply   Report abuse  
Picture of brijendra singh brijendra singh - 2012-12-12 13:43:08 - In reply to message 7 from Manuel Lemos
Oh. I worked further after my first post. and then sent you the previous message. After trying many things, now it takes me to the yahoo login page, it logs in correctly and then sends me back to my URL but here it prints nothing in $user Object. when i print client object i get this:

oauth_client_class Object
(
[error] =>
[debug] => 1
[debug_http] => 1
[exit] =>
[debug_output] => OAuth client: Checking the OAuth token authorization state
OAuth client: The OAuth token is not yet authorized
OAuth client: Checking the OAuth token and verifier
OAuth client: Accessing the OAuth access token at https://api.login.yahoo.com/oauth/v2/get_token
OAuth client: Access token expiry: 2012-12-12 13:35:28 UTC
OAuth client: The OAuth token was authorized
OAuth client: Accessing the API call at http://social.yahooapis.com/v1/user/me/contacts?format=json&count=5

[debug_prefix] => OAuth client:
[server] => Yahoo
[request_token_url] => https://api.login.yahoo.com/oauth/v2/get_request_token
[dialog_url] => https://api.login.yahoo.com/oauth/v2/request_auth
[append_state_to_redirect_uri] =>
[access_token_url] => https://api.login.yahoo.com/oauth/v2/get_token
[oauth_version] => 1.0a
[url_parameters] =>
[authorization_header] =>
[redirect_uri] => http://***********/oauth_blti/login_with_yahoo.php
[client_id] => **************
[client_secret] => ******************
[scope] =>
[access_token] => ************
[access_token_secret] => ******************
[access_token_expiry] => 2012-12-12 13:35:28
[access_token_type] =>
[access_token_error] =>
[authorization_error] =>
[response_status] => 200
[oauth_user_agent] => PHP-OAuth-API (http://www.phpclasses.org/oauth-api $Revision: 1.38 $)
[session_started] => 1
)

I was willing to get the user data same as i get for google and facebook such as emails, name etc.
Can you please help me what is going on wrong here. Is there something like the issue of permissions from yahoo for the application. yahoo application generates 3 values, app ID, Consumer Key, Consumer Secret.
Is there any use of this app ID because i saw other applications using all the 3 values.

  9. Re: Doesn't seem to be working on yahoo   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2012-12-13 01:33:22 - In reply to message 8 from brijendra singh
I just tried it here with this code and it works.

$success = $client->CallAPI(
'http://social.yahooapis.com/v1/user/me/contacts',
'GET', array(
'count'=>'5',
'format'=>'json'
), array('FailOnAccessError'=>true), $user);

Keep in mind that you need to give the right permissions to access the Yahoo contacts API. Go in this page, choose your application and in the Contacts section select at least one of these options:

Read
With your user's permission, you can read their Contacts information.

Read/Write
With your user's permission, you can read and write their Contacts information.

developer.apps.yahoo.com/projects

Then save the changes and Yahoo will generate a new consumer secret. You need to use that as your new value for the class client_secret variable.

  10. Re: Doesn't seem to be working on yahoo   Reply   Report abuse  
Picture of brijendra singh brijendra singh - 2012-12-13 12:12:06 - In reply to message 9 from Manuel Lemos
The code you wrote is working fine, its showing me the yahoo contacts. but I want to implement login using yahoo and i need email address of the user back from yahoo to identify the user uniquely. Here in case of Yahoo i tried many things but i am not getting the email address back, all the permissions for the Yahoo App are correct but still I am not getting the user profile information.
I also tried these API calls also:
social.yahooapis.com/v1/user/guid/p ...
query.yahooapis.com/v1/yql
api.login.yahoo.com/oauth/v2/

but it doesn't seem to be working in my case.

 
  1 - 10   11 - 11