Skip to content

Fetching credentials

Load an existing token or obtain a new one

token_fetch()
Fetch a token for the given scopes
credentials_app_default()
Load Application Default Credentials
credentials_byo_oauth2()
Load a user-provided token
credentials_external_account()
Get a token for an external account
credentials_gce()
Get a token from the Google metadata server
credentials_service_account()
Load a service account token
credentials_user_oauth2()
Get an OAuth token for a user
gargle_oauth_sitrep()
OAuth token situation report
cred_funs_list() cred_funs_add() cred_funs_set() cred_funs_clear() cred_funs_list_default() cred_funs_set_default() local_cred_funs() with_cred_funs()
Credential function registry
gargle_oauth_client_from_json() gargle_oauth_client()
Create an OAuth client for Google
gargle_oauth_email() gargle_oob_default() gargle_oauth_cache() gargle_oauth_client_type() gargle_verbosity() local_gargle_verbosity() with_gargle_verbosity()
Options consulted by gargle
token_userinfo() token_email() token_tokeninfo()
Get info from a token
gce_instance_service_accounts()
List all service accounts available on this GCE instance
secret_encrypt_json() secret_decrypt_json() secret_make_key() secret_write_rds() secret_read_rds() secret_has_key()
Encrypt/decrypt JSON or an R object

Requests and responses

Helpers for forming HTTP requests and processing the response

request_develop() request_build()
Build a Google API request
request_make()
Make a Google API request
request_retry()
Make a Google API request, repeatedly
response_process() response_as_json() gargle_error_message()
Process a Google API response
field_mask()
Generate a field mask

Classes

Classes to represent a token or auth state and their constructors

Gargle-class Gargle2.0
OAuth2 token objects specific to Google APIs
gargle2.0_token()
Generate a gargle token
AuthState-class AuthState
Authorization state
init_AuthState()
Create an AuthState

Options

Demo assets

Assets to aid experimentation during development (not for production use!)

gargle_api_key()
API key for demonstration purposes