Skip to content
This repository has been archived by the owner on Apr 18, 2019. It is now read-only.

ydn/async_profile_fetch

Repository files navigation

Async Profile Fetch

This sample code uses OAuth to allow users to authorize access to their Yahoo! Profile data, stores the access token, and then fetches this data asynchronously.

Suppose you have a service that uses Yahoo! data requiring authorization via OAuth and you display that data on a publicly available page. For example, you have comments on your pages, and you use the Yahoo! Profile API to display the name Yahoo! Profile picture of each comment author. To do this, you need to store an OAuth access token for each user. To increase the performance of your page, you might want to request this data after the page loads.

For simplicity's sake, OAuth tokens are stored in a local file and security precautions are omitted. This code is only intended for demonstration purposes. If you have trouble with the code or this documentation, please note it in the issues section of this project.

Requirements

Usage

  1. Download this project to your server.
    Make sure it's accessible via the url you used to create your Yahoo! OAuth key and secret
  2. Edit config.php to use your OAuth key, secret, app id, and callback url
  3. Edit comments.php to use the Yahoo! guids of your users.
    Normally, the user would be logged in at the time the comments are posted, so the guids would already be associated with the comments when they are viewed.
  4. Load init.php in a browser and authorize access.
    After authorization, you'll be redirected to comments.php, which will load the profile data

License

About

sample code for fetching yahoo profile data asynchronously using stored oauth token

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages