Reference documentation and code samples for the Google Cloud Tasks V2 Client class OAuthToken.
Contains information needed for generating anOAuth token.
This type of authorization should generally only be used when calling Google
APIs hosted on *.googleapis.com.
Generated from protobuf messagegoogle.cloud.tasks.v2.OAuthToken
Namespace
Google \ Cloud \ Tasks \ V2
Methods
__construct
Constructor.
Parameters
Name
Description
data
array
Optional. Data for populating the Message object.
↳ service_account_email
string
Service account emailto be used for generating OAuth token. The service account must be within the same project as the queue. The caller must have iam.serviceAccounts.actAs permission for the service account.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Google Cloud Tasks V2 Client - Class OAuthToken (2.0.2)\n\nVersion latestkeyboard_arrow_down\n\n- [2.0.2 (latest)](/php/docs/reference/cloud-tasks/latest/V2.OAuthToken)\n- [2.0.1](/php/docs/reference/cloud-tasks/2.0.1/V2.OAuthToken)\n- [1.15.2](/php/docs/reference/cloud-tasks/1.15.2/V2.OAuthToken)\n- [1.14.6](/php/docs/reference/cloud-tasks/1.14.6/V2.OAuthToken)\n- [1.13.2](/php/docs/reference/cloud-tasks/1.13.2/V2.OAuthToken)\n- [1.12.2](/php/docs/reference/cloud-tasks/1.12.2/V2.OAuthToken)\n- [1.11.11](/php/docs/reference/cloud-tasks/1.11.11/V2.OAuthToken) \nReference documentation and code samples for the Google Cloud Tasks V2 Client class OAuthToken.\n\nContains information needed for generating an\n[OAuth token](https://developers.google.com/identity/protocols/OAuth2).\n\nThis type of authorization should generally only be used when calling Google\nAPIs hosted on \\*.googleapis.com.\n\nGenerated from protobuf message `google.cloud.tasks.v2.OAuthToken`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ Tasks \\\\ V2\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getServiceAccountEmail\n\n[Service account email](https://cloud.google.com/iam/docs/service-accounts)\nto be used for generating OAuth token.\n\nThe service account must be within the same project as the queue. The\ncaller must have iam.serviceAccounts.actAs permission for the service\naccount.\n\n### setServiceAccountEmail\n\n[Service account email](https://cloud.google.com/iam/docs/service-accounts)\nto be used for generating OAuth token.\n\nThe service account must be within the same project as the queue. The\ncaller must have iam.serviceAccounts.actAs permission for the service\naccount.\n\n### getScope\n\nOAuth scope to be used for generating OAuth access token.\n\nIf not specified, \"\u003chttps://www.googleapis.com/auth/cloud-platform\u003e\"\nwill be used.\n\n### setScope\n\nOAuth scope to be used for generating OAuth access token.\n\nIf not specified, \"\u003chttps://www.googleapis.com/auth/cloud-platform\u003e\"\nwill be used."]]