Reference documentation and code samples for the googleauth class Google::Auth::DefaultCredentials.
DefaultCredentials is used to preload the credentials file, to determine which type of credentials should be loaded.
Inherits
- Object
Extended By
Methods
.determine_creds_class
def self.determine_creds_class(json_key_io) -> Array(Hash, Class)
Reads the input json and determines which creds class to use.
- json_key_io (IO) — An IO object containing the JSON key
- (Array(Hash, Class)) — The JSON key and the credential class to use
- (Google::Auth::InitializationError) — If the JSON is missing the type field or has an unsupported type
.make_creds
def self.make_creds(options = {}) -> Google::Auth::Credentials
Override CredentialsLoader#make_creds to use the class determined by loading the json.
Important: If you accept a credential configuration (credential JSON/File/Stream) from an external source for authentication to Google Cloud, you must validate it before providing it to any Google API or library. Providing an unvalidated credential configuration to Google APIs can compromise the security of your systems and data. For more information, refer to Validate credential configurations from external sources.
- options (Hash) — Options for creating the credentials
- (Google::Auth::Credentials) — The credentials instance
- (Google::Auth::InitializationError) — If the credentials cannot be determined
.read_creds
def self.read_creds() -> Class
Reads the credential type from environment and returns the appropriate class
- (Class) — The credential class to use
- (Google::Auth::InitializationError) — If the credentials type is undefined or unsupported