googleauth - Module Google::Auth (v1.15.1)

Reference documentation and code samples for the googleauth module Google::Auth.

Module Auth provides classes that provide Google-specific authorization used to access Google APIs.

Methods

.get_application_default

defself.get_application_default(scope=nil,options={})
Parameters
  • scope (string|array|nil) — the scope(s) to access
  • options (Hash) —

    Connection options. These may be used to configuretheFaraday::Connection used for outgoing HTTP requests. Forexample, if a connection proxy must be used in the current network,you may provide a connection with with the needed proxy options.The following keys are recognized:

    • :default_connection The connection object to use for tokenrefresh requests.
    • :connection_builder AProc that creates and returns aconnection to use for token refresh requests.
    • :connection The connection to use to determine whether GCEmetadata credentials are available.
Raises

Constants

VERSION

value:"1.15.1".freeze

NO_METADATA_SERVER_ERROR

value:<<~ERROR.freeze Error code 404 trying to get security access token from Compute Engine metadata for the default service account. This may be because the virtual machine instance does not have permission scopes specified.ERROR

UNEXPECTED_ERROR_SUFFIX

value:<<~ERROR.freeze trying to get security access token from Compute Engine metadata for the default service accountERROR

NOT_FOUND_ERROR

value:<<~ERROR_MESSAGE.freeze Your credentials were not found. To set up Application Default Credentials for your environment, seehttps://cloud.google.com/docs/authentication/external/set-up-adcERROR_MESSAGE

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-10-30 UTC.