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
WWW::Contact::GoogleContactsAPIOAuth2(3) User Contributed Perl Documentation WWW::Contact::GoogleContactsAPIOAuth2(3)

    # Create a WWW::Contact object as usual
    my $wc = WWW::Contact->new;

    # Then we need to update the 'gmail.com' known_supplier
    # to use this GoogleContactsAPIOAuth2 module instead of the
    # default GoogleContactsAPI module.
    my $ks = $wc->known_supplier;
    $ks->{'gmail.com'} = 'GoogleContactsAPIOAuth2';
    $wc->known_supplier( $ks );

    # Pass in the access_token as the password
    # And you get the contacts using OAuth rather than AuthSub with user/pass
    my $contacts = $wc->get_contacts( $email, $access_token );

    This module allows you to get google contacts using an OAuth2 token
    (Can be gotten with L<Net::Oauth2::Client>), rather than using AuthSub
    with a username/passwerd.  Google has begun warning users when third
    parties access their account with username/password, so it is becoming bad
    practice to do so.  Using OAuth avoids this problem.

    To use this module, you need to use something like L<Net::Oauth2::Client>
    to retrieve a valid access token for the desired user.  Then you need to
    replace the default C<known_supplier> for C<gmail.com> with
    L<GoogleContactsAPIOAuth2> as shown above in the synopsis.  Then you simply
    pass that C<OAuth> access token as the C<password> field when you call
    get_contacts, and you get all of the contacts using OAuth.
2018-02-28 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

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