WebService::GoogleAPI::Client::AuthStorage::ServiceAccount - Manage access tokens from a service account file
version 0.27
This class provides an auth backend for service account files downloaded from your google cloud console. For user accounts, please see WebService::GoogleAPI::AuthStorage::GapiJSON.
This backend is only for explicitly passing a service account JSON file. It will not attempt to find one by itself, or to do the Application Default Credentials, at least yet.
This backend will cache tokens in memory for any set of scopes requested, and for any user you ask to impersonate (more on that later).
This class mixes in WebService::GoogleAPI::Client::AuthStorage, and provides all attributes and methods from that role. As noted there, the ua is usually managed by the WebService::GoogleAPI::Client object this is set on.
ua
A read/write attribute containing the scopes the service account is asking access to. Will coerce a space seperated list of scopes into the required arrayref of scopes.
The user you want to impersonate. Defaults to the empty string, which signifies no user. In order to impersonate a user, you need to have domain-wide delegation set up for the service account.
The location of the file containing the service account credentials. This is downloaded from your google cloud console's service account page.
An instance of Mojo::JWT::Google used for retrieving the access tokens. This is built whenever the path attribute is set.
path
A hash for caching the tokens that have been retrieved by this object. It caches on scopes (via the scopes_string method) and then user.
scopes_string
Return an access token for the current user (if any) and scopes from the cache if exists, otherwise retrieve a new token with refresh_access_token.
refresh_access_token
Retrieve an access token for the current user (if any) and scopes from Google's auth API, using a JWT.
Return the list of scopes as a space seperated string.
Veesh Goldman <veesh@cpan.org>
This software is Copyright (c) 2017-2023 by Veesh Goldman and Others.
This is free software, licensed under:
The Apache License, Version 2.0, January 2004
To install WebService::GoogleAPI::Client, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WebService::GoogleAPI::Client
CPAN shell
perl -MCPAN -e shell install WebService::GoogleAPI::Client
For more information on module installation, please visit the detailed CPAN module installation guide.