The Artima Developer Community
Sponsored Link

Ruby Buzz Forum
Ruby wrapper for Yahoo! Browser-Based Authentication

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Premshree Pillai

Posts: 478
Nickname: premshree
Registered: Mar, 2004

Premshree Pillai is a Ruby evangelist, working with Yahoo!.
Ruby wrapper for Yahoo! Browser-Based Authentication Posted: Oct 1, 2006 11:18 AM
Reply to this message Reply

This post originated from an RSS feed registered with Ruby Buzz by Premshree Pillai.
Original Post: Ruby wrapper for Yahoo! Browser-Based Authentication
Feed Title: Premshree's Personal Weblog
Feed URL: http://premshree.livejournal.com/data/rss
Feed Description: Premshree's Weblog
Latest Ruby Buzz Posts
Latest Ruby Buzz Posts by Premshree Pillai
Latest Posts From Premshree's Personal Weblog

Advertisement

As you probably know we launched Browser-Based Authentication. What this means is that users can grant third-party web-based applications access to their Yahoo! data. (Actually, this could be used for non web-based apps too.) For a more detailed explanation, go here.

Anyway, I’ll explain how this works using the Ruby interface I just wrote and (sorta) tested:

  • Registering your web application: First off, you need to register your web application. After registration you’ll get your appid and shared secret.
  • Logging-in users:

    obj = YBBAuth.new(appid, secret)
    obj.get_auth_url('')

    Once you get the auth URL, direct the user there. Now the user is informed that your amazing web application is asking for permissions (read, write or both) and whether he wishes to grant permission, etc. Once the user grants permission, Yahoo! will redirect the user to your application (you would’ve submitted the URL when registering for an appid).
  • Getting user credentials: When Yahoo! redirects the user, it adds a token parameter to the URL. You need to extract this token in order to get user credentials:

    obj.get_access_credentials(token)

  • Making an authenticated request: Now you can make authenticated GET/POST requests:

    obj.ws_auth_get_request('http://photos.yahooapis.com/V3.0/listAlbums')

    The above snippet makes use of the Yahoo! Photos API.

» The Ruby wrapper

The interface isn’t complete or well-tested (I have a flight to catch in a few hours so I need to leave in a bit). I’ll work on it in a day or two.

Read: Ruby wrapper for Yahoo! Browser-Based Authentication

Topic: Of Course Steve Yegge Hates Pair Programming Previous Topic   Next Topic Topic: How to test web software?

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use