MrSwitch/hello.js

Yahoo via OAuth2

Open

#192 aperta il 4 feb 2015

Vedi su GitHub
 (30 commenti) (0 reazioni) (0 assegnatari)JavaScript (557 fork)batch import
good first issue

Metriche repository

Star
 (4630 star)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

Hi,

I have done it myself for Yahoo via its new OAuth2 (https://developer.yahoo.com/oauth2/guide/#implicit-grant-flow-for-client-side-apps).

The Authentication is working just fine, and can get you the access token. However, the Contact API is not working as Yahoo server is not returning the correct Access-Control-Allow-Origin header cause the browser to block the Cross-Origin xhr call.

So the only solution was to take the Access Token and follow the rest via CURL (where it works just fine).

CONCEPTS:

  1. Creating API Access keys from Yahoo.com will require you to insert .com in your localhost. So make a vhost that has .com

  2. Yahoo's OAuth server will not accept such large URL and hence return an error the details of which are not so listed anywhere. So except for state>callback parameter, rest all are passed to the processing page via Session and reinserted into hello.js upon successful authentication.

Guida contributor