headers ( Mapping) – The request’s headers.url ( str) – The request’s URI or the RPC service’s URI.method ( str) – The request’s HTTP method or the RPC method being.Refreshes the credentials if necessary, then calls apply() to Performs credential-specific before request logic. token ( Optional ) – If specified, overrides the current accessīefore_request ( request, method, url, headers ) ¶.headers ( Mapping) – The HTTP request headers.Type:Īpply the token to the authentication header. – If the credentials couldĪn email address that identifies the signer. Quota_project_id ( str) – The project to use for quota and Returns a copy of these credentials with a modified quota project. With_quota_project ( quota_project_id ) ¶ Parameters:Īdditional_claims ( Mapping ) – Any additional claims for Returns a copy of these credentials with modified claims. This can be avoided by checking requires_scopes beforeĬreate a copy of these credentials with the specified subject. NotImplementedError – If the credentials’ scopes can not be changed. Scopes ( Sequence ) – The list of scopes to attach to the With_scopes ( scopes, default_scopes=None ) ¶Ĭreate a copy of these credentials with the specified scopes. True if there are no scopes set otherwise False. requires_scopes ¶Ĭhecks if the credentials requires scopes. Project ID associated with this credential. filename ( str) – The path to the service account json file.ValueError – If the info is not in the expected format.Ĭlassmethod from_service_account_file ( filename, **kwargs ) ¶Ĭreates a Credentials instance from a service account json file. kwargs – Additional arguments to pass to the constructor.info ( Mapping ) – The service account info in Google.classmethod from_service_account_info ( info, **kwargs ) ¶Ĭreates a Credentials instance from parsed service account info. To create credentials using a Google service accountįrom_service_account_info() are used instead of calling theĬonstructor directly. Usually, you’ll create these credentials with one of the helperĬonstructors. class Credentials ( signer, service_account_email, token_uri, scopes=None, default_scopes=None, subject=None, project_id=None, quota_project_id=None, additional_claims=None ) ¶īases:, , You can use domain-wise delegation by creating a set of credentials with a This authorization step is referred to as “delegating domain-wide The Google Apps administrator must explicitly authorize the service account toĭo this. To access the Google Calendar API on behalf of users. The calendars of all users in a Google Apps domain would use a service account Obtained OAuth 2.0 access token is used as the bearer token.ĭomain-wide delegation allows a service account to access user data onīehalf of any user in a Google Apps domain without consent from the user.įor example, an application that uses the Google Calendar API to add events to Profile instead only uses the JWT to obtain an OAuth 2.0 access token. This profile also differs from the authenticationīecause the JWT credentials use the JWT directly as the bearer token. The use of the private key allows this profile to assert This profile differs from normal OAuth 2.0 profile because no user consent The acquired access token is used as the bearer token when making requests The JWT is only used for this purpose, as In place of the usual authorization token returned during the standard This profile uses a JWT to acquire an OAuth 2.0 access token. However, an application that needs to access a user’s Drive documents wouldĪdditionally, Google Apps domain administrators can grant service accountsĭomain-wide delegation authority to access user data on behalf of users in For example,Īn application that uses Google Cloud Datastore for data persistence would useĪ service account to authenticate its calls to the Google Cloud Datastore API. Google APIs to work with its own data rather than a user’s data. Typically an application uses a service account when the application uses In contrast to other OAuth 2.0 profiles, no users are involved and yourĪpplication “acts” as the service account. Service account belongs to your application instead of to an individual end Interactions between a web application server and a Google service. Service accounts are used for server-to-server communication, such as This module implements the JWT Profile for OAuth 2.0 Authorization GrantsĪs defined by RFC 7523 with particular support for how this RFC is Service Accounts: JSON Web Token (JWT) Profile for OAuth 2.0
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |