Thank you! Your feedback has been delivered
Thank you! Your feedback has been sent

Inegrate yahoo signin to my nodejs web app

Need to integrate yahoo one click signin to my nodejs web app. No html needed Need access to user's emails (read only) and read the user's email address. Cannot ask permission for accessing private profile details The issue here is that when using oauth you can easily accomplish the emails reading permission (used npm passport-yahoo-oauth for that) but it does not give you the user's email (unless you ask for scary permissions). Using openid, I could not get the tokens for reading user's emails but got the email address (used npm passport-oauth for that) You can create a consumerID on http://developer.apps.yahoo.com, I will anyway use mine Code must be in javascript for nodejs

User Gravatar

felixkoblenz

Posted Jun 18 2014 0:18 PDT

$50


  • Assigned To omab
  • Solved
  • javascript
    node.js
    node
  • 704 Views

5 Replies


You can retrieve the basic user information when using Yahoo OAuth1 protocol by calling this URL:

'https://social.yahooapis.com/v1/user/ACCESS_TOKEN_HERE/profile?format=json'

Just fill the access token in that URL, the email should be part of the response.

User Gravatar

omab

Posted Jun 18 2014 8:31 PDT

Did that and got response 404 record not found

User Gravatar

user2425

Posted Jun 18 2014 9:13 PDT

Did that and got response 404 record not found. Also, checked passport-yahoo-oauth and they are actually using this API already to get the user profile (though the format you mentioned is not correct) and the profile does not contain the user email, so this does not help.

Also, and forgive me for saying, I wasted some time trying to check omab's answer. I will only check answers with complete code at which I need only replace the consumer id.

Sorry, Felix

User Gravatar

felixkoblenz

Posted Jun 18 2014 10:34 PDT

@felixkoblenz,

I've created a very simple expressjs app that does auth with passport-yahoo-oauth (the Yahoo Application only asks for Read Access to user emails, you cannot access that API without this scope).

In order to get the user email the app will call the GetUserData API endpoint, then it will call ListMessages over the Inbox folder.

The app is really simple, it doesn't store the user or anything, just probes how's the API needs to be called once the user token was retrieved.

You can find the code here http://matiasaguirre.net/yahoo-emails-example.tar.gz.

Also in this Gist https://gist.github.com/omab/9dcc94a4f8e774f7b2ec, check the comment at the bottom.

User Gravatar

omab

Posted Jun 22 2014 13:27 PDT

Solution

This didn't solve your task? Get your own custom solution.

Great answer, thanks

User Gravatar

felixkoblenz

Posted Jun 23 2014 7:46 PDT

Add a reply

By posting a reply on CodersClan you agree to our Terms & Conditions