Yahoo::BBAuth - Perl interface to the Yahoo! Browser-Based Authentication.
my $bbauth = Yahoo::BBAuth->new( appid => $appid, secret => $secret, ); # Create an authentication link printf '<a href="%s">Click here to authorize</a>', $bbauth->auth_url; # 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 'Authentication Successful'; } else { print 'Authentication Failed. Error is: '.$bbauth->sig_validation_error; } my $url = 'http://photos.yahooapis.com/V1.0/listAlbums'; my $xml = $bbauth->auth_ws_get_call($url); unless ($xml) { print 'WS call setup Failed. Error is: '. $bbauth->access_credentials_error; } else { print 'Look at response for other errors or success: '.$xml; }
This module priovides you an Object Oriented interface for Yahoo! Browser-Based Authentication.
This module is ported from official PHP class library(http://developer.yahoo.com/auth/quickstart/bbauth_quickstart.zip).
Returns an instance of this module. You must set the your application id and shared secret.
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(optinal).
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.
Validates the signature returned by Yahoo's browser authentication services.
Returns true if the sig is validated. Returns undef if any error occurs. If undef is returned, $self->sig_validation_error should contain a string describing the error.
Make an authenticated web services call using HTTP GET. Returns responce 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, the error is stored in $self->access_credentials_error.
Make an authenticated web services call using HTTP POST.
Returns error message when validate_sig failed.
Returns error message when auth_ws_get_call or auth_ws_post_call failed.
Jiro Nishiguchi <jiro@cpan.org>
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
http://developer.yahoo.com/auth/
To install Yahoo::BBAuth, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Yahoo::BBAuth
CPAN shell
perl -MCPAN -e shell install Yahoo::BBAuth
For more information on module installation, please visit the detailed CPAN module installation guide.