WebService::GoogleAPI::Client::AuthStorage::GapiJSON - Auth Storage Backend based on gapi.json
version 0.27
This class provides an auth backend for gapi.json files produced with the provided goauth script. This is used for user credentials. For service accounts, please see WebService::GoogleAPI::Client::AuthStorage::ServiceAccount.
In future versions, I hope to provide the functionality of goauth as a Mojolicious::Plugin, so you can provide this flow in your app rather than having to run it offline.
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
The location of the gapi.json file. Default to gapi.json in the current directory.
A Config::JSON object that contains the parsed gapi.json file. Authomatically set at object instantiation.
Returns the access token for the current user.
This will refresh the access token for the currently set user. Will write the new token back into the gapi.json file.
user
If you don't have a refresh token for that user, it will die with the following message:
If your credentials are missing the refresh_token - consider removing the auth at https://myaccount.google.com/permissions as The oauth2 server will only ever mint one refresh token at a time, and if you request another access token via the flow it will operate as if you only asked for an access token.
A method to get stored fields from the gapi.json file. Will retrieve tokens for the current user, and other fields from the global config.
Read-only accessor returning the list of scopes configured in the gapi.json file.
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.