class Google::Auth::BearerTokenCredentials

Implementation of Bearer Token authentication scenario.

Bearer tokens are strings representing an authorization grant. They can be OAuth2 (“ya.29”) tokens, JWTs, IDTokens – anything that is sent as a ‘Bearer` in an `Authorization` header.

Not all ‘authentication’ strings can be used with this class, e.g. an API key cannot since API keys are sent in a ‘x-goog-api-key` header or as a query parameter.

This class should be used when the end-user is managing the authentication token separately, e.g. with a separate service. This means that tasks like tracking the lifetime of and refreshing the token are outside the scope of this class.

There is no JSON representation for this type of credentials. If the end-user has credentials in JSON format they should typically use the corresponding credentials type, e.g. ServiceAccountCredentials with the service account JSON.