- COPYRIGHT AND LICENSE
WebService::GoogleAPI::Client::AuthStorage::ServiceAccount - Manage access tokens from a service account file
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.
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.
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.
Return an access token for the current user (if any) and scopes from the cache if exists, otherwise retrieve a new token with
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 <firstname.lastname@example.org>
Peter Scott <email@example.com>
This software is Copyright (c) 2017-2021 by Peter Scott and others.
This is free software, licensed under:
The Apache License, Version 2.0, January 2004