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  -  NET::GOOGLE::DATAAPI::AUTH::OAUTH2 (3)

.ds Aq ’

NAME

Net::Google::DataAPI::Auth::OAuth2 - OAuth2 support for Google Data APIs

CONTENTS

SYNOPSIS



  use Net::Google::DataAPI::Auth::OAuth2;

  my $oauth2 = Net::Google::DataAPI::Auth::OAuth2->new(
    client_id => xxxxxxxxxxxxxxxxxxxxxx.apps.googleusercontent.com,
    client_secret => mys3cr33333333333333t,
    scope => [http://spreadsheets.google.com/feeds/],

    # with web apps, redirect_uri is needed:
    #
    #   redirect_uri => http://your_app.sample.com/callback,

  );
  my $url = $oauth2->authorize_url();

  # show the user $url and get $code
  # if youre making web app, you will do:
  #
  #   return $c->redirect($auth->authorize_url());
  #
  # getting $code from the request to the redirect_uri in web apps:
  #
  #   my $code = $c->req->param(code);
  #
  # in installed apps:
  #
  #   use Term::Prompt;
  #   my $code = prompt(x, paste the code: , , );

  my $token = $oauth2->get_access_token($code) or die;

  # after retrieving $token, you can use $oauth2 with Net::Google::DataAPI items:

  my $client = Net::Google::Spreadsheets->new(auth => $oauth2);



DESCRIPTION

Net::Google::DataAPI::Auth::OAuth2 interacts with google OAuth 2.0 service and adds Authorization header to given request.

ATTRIBUTES

You can make Net::Google::DataAPI::Auth::OAuth2 instance with those arguments below:
o client_id

client id. You can get it at <https://code.google.com/apis/console#access>.

o client_secret

The client secret paired with the client id.

o scope

URL identifying the service(s) to be accessed. You can see the list of the urls to use at <http://code.google.com/intl/en-US/apis/gdata/faq.html#AuthScopes>

o redirect_url

OAuth2 redirect url. ’urn:ietf:wg:oauth:2.0:oob’ will be used if you don’t specify it.

See <https://developers.google.com/accounts/docs/OAuth2> for details.

AUTHOR

Nobuo Danjou <danjou@soffritto.org>

SEE ALSO

Net::OAuth2

<https://developers.google.com/accounts/docs/OAuth2>

you can see sample implementations for oauth2 client both as installed and web app in the eg directory of this distribution.

LICENSE

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 NET::GOOGLE::DATAAPI::AUTH::OAUTH2 (3) 2012-04-06

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