GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  YAHOO::BBAUTH (3)

.ds Aq ’

NAME

Yahoo::BBAuth - Perl interface to the Yahoo! Browser-Based Authentication.

CONTENTS

SYNOPSIS



      my $bbauth = Yahoo::BBAuth->new(
          appid  => $appid,
          secret => $secret,
      );
      # Get your appid and secret by registering your application here:
      # https://developer.yahoo.com/wsregapp/index.php
      # Create an authentication link
      printf <a href="%s">Click here to authorize</a>, $bbauth->auth_url;
      # You can include some application data or return a user hash using optional params:
      printf <a href="%s">Click here to authorize</a>, $bbauth->auth_url(
          send_userhash  => 1,
          appdata => someappdata,
          ); 
      # After the user authenticates successfully, Yahoo returns the user to the page you
      # dictated when you signed up. To verify whether authentication succeeded, you need to
      # validate the signature:
      if (!$bbauth->validate_sig()) {
      print <h2>Authentication Failed. Error is: </h2>.$bbauth->{sig_validation_error};
      exit(0);
      }
      # You can then make an authenticated web service call on behalf of the user
      # For Yahoo! Mail:
      my $json = $bbauth->make_jsonrpc_call(ListFolders, [{}] );
      if (!$json) {
            print <h2>Web services call failed. Error is:</h2> . $bbauth->{access_credentials_error};
            exit(0);
      }
      # For Yahoo! Photos:
      my $url = http://photos.yahooapis.com/V3.0/listAlbums?;
      my $xml = $bbauth->auth_ws_get_call($url);
      if (!$xml) {
          print <h2>Web services call failed. Error is:</h2> . $bbauth->{access_credentials_error};
          exit(0);
      }



DESCRIPTION

This module priovides an Object Oriented interface for Yahoo! Browser-Based Authentication.

This module is ported from the official PHP class which is located on this page: http://developer.yahoo.com/php

METHODS

new(appid => CW$appid, secret => CW$secret)

Returns an instance of this module. You must set the your application id and shared secret.

    auth_url(%param)

Create the Login URL used to fetch authentication credentials. This is the first step in the browser authentication process.

You can set the %param to send_userhash and appdata if you need(optional).

The appdata typically a session id that Yahoo will transfer to the target application upon successful authentication.

If send_userhash set, the send_userhash=1 request will be appended to the request URL so that the userhash will be returned by Yahoo! after successful authentication.

    validate_sig

Validates the signature returned by Yahoo’s browser authentication services.

Returns false if the sig is invalid. Returns 0 if any error occurs. If 0 is returned, $self->sig_validation_error should contain a string describing the error.

    auth_ws_get_call($url)

Make an authenticated web services call using HTTP GET. Returns response if successful, a string is returned containing the web service response which might be XML, JSON, or some other type of text. If an error occurs, 0 is returned, and the error is stored in $self->access_credentials_error.

    auth_ws_post_call($url)

Make an authenticated web services call using HTTP POST.

make_jsonrpc_call($method, CW$params)

Make an authenticated web services JSON-RPC call.

    sig_validation_error

The error message when validate_sig fails.

    access_credentials_error

The error message when auth_ws_get_call or auth_ws_post_call fail.

ACCESSORS

appid
secret
userhash
appdata
timeout
token
WSSID
cookie

AUTHORS



  Jiro Nishiguchi <jiro@cpan.org>
  Jason Levitt <jlevitt@yahoo-inc.com>



This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

SEE ALSO

o http://developer.yahoo.com/auth/
Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 YAHOO::BBAUTH (3) 2007-03-28

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.