WWW::Google::Cloud::Auth::ServiceAccount - Service account based OAuth authentication for Google Cloud APIs
my $auth = WWW::Google::Cloud::Auth::ServiceAccount>new( credentials_path => '/home/myapp/priv/google_some_service.json', ); my $response = $ua->post( $some_google_cloud_api_endpoint, 'Content-Type' => 'application/json; charset=utf-8', 'Authorization' => 'Bearer ' . $auth->get_token, Content => $arguments, );
This is a library for service account based OAuth authentication with Google Cloud API endpoints for server to server applications. See: https://developers.google.com/identity/protocols/OAuth2ServiceAccount
Instantiate a new WWW::Google::Cloud::Auth::ServiceAccount object.
Arguments:
credentials path [required]
The path to the JSON-encoded credentials file provided by Google.
auth_url [optional]
The URL to get the OAuth token from. Defaults to https://www.googleapis.com/oauth2/v4/token. You probably don't need to change this.
Returns:
A new WWW::Google::Cloud::Auth::ServiceAccount instance.
Get a valid token to use for authorization. If there is a valid cached token return that.
None
The OAuth token
This module is written by Larion Garaczi <larion@cpan.org> (2019)
The source code for this module is hosted on GitHub https://github.com/larion/www-google-cloud-auth-serviceaccount.
Feel free to contribute :)
This module is free software and is published under the same terms as Perl itself.
To install WWW::Google::Cloud::Auth::ServiceAccount, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WWW::Google::Cloud::Auth::ServiceAccount
CPAN shell
perl -MCPAN -e shell install WWW::Google::Cloud::Auth::ServiceAccount
For more information on module installation, please visit the detailed CPAN module installation guide.