| Class | Google::Auth::ServiceAccountJwtHeaderCredentials |
| In: |
lib/googleauth/service_account.rb
|
| Parent: | Object |
Authenticates requests using Google‘s Service Account credentials via JWT Header.
This class allows authorizing requests for service accounts directly from credentials from a json key file downloaded from the developer console (via ‘Generate new Json Key’). It is not part of any OAuth2 flow, rather it creates a JWT and sends that as a credential.
cf [Application Default Credentials](goo.gl/mkAHpZ)
| JWT_AUD_URI_KEY | = | :jwt_aud_uri |
| AUTH_METADATA_KEY | = | Signet::OAuth2::AUTH_METADATA_KEY |
| TOKEN_CRED_URI | = | "https://www.googleapis.com/oauth2/v4/token".freeze |
| SIGNING_ALGORITHM | = | "RS256".freeze |
| EXPIRY | = | 60 |
| project_id | [R] |
make_creds proxies the construction of a credentials instance
make_creds is used by the methods in CredentialsLoader.
By default, it calls new with 2 args, the second one being an optional scope. Here‘s the constructor only has one param, so we modify make_creds to reflect this.
Initializes a ServiceAccountJwtHeaderCredentials.
@param json_key_io [IO] an IO from which the JSON key can be read
Construct a jwt token if the JWT_AUD_URI key is present in the input hash.
The jwt token is used as the value of a ‘Bearer ’.