public sealed class Pipeline.Types.Destination.Types.AuthenticationConfig.Types.OAuthToken : IMessage<Pipeline.Types.Destination.Types.AuthenticationConfig.Types.OAuthToken>, IEquatable<Pipeline.Types.Destination.Types.AuthenticationConfig.Types.OAuthToken>, IDeepCloneable<Pipeline.Types.Destination.Types.AuthenticationConfig.Types.OAuthToken>, IBufferMessage, IMessage
Reference documentation and code samples for the Eventarc v1 API class Pipeline.Types.Destination.Types.AuthenticationConfig.Types.OAuthToken.
Contains information needed for generating an
OAuth token.
This type of authorization should generally only be used when calling
Google APIs hosted on *.googleapis.com.
Required. Service account email used to generate the OAuth
token.
The principal who calls this API must have
iam.serviceAccounts.actAs permission in the service account. See
https://cloud.google.com/iam/docs/understanding-service-accounts?hl=en#sa_common
for more information. Eventarc service agents must have
roles/roles/iam.serviceAccountTokenCreator role to allow Pipeline
to create OAuth2 tokens for authenticated requests.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["\u003cp\u003eThe latest version of the \u003ccode\u003eOAuthToken\u003c/code\u003e class for the Eventarc v1 API is 2.6.0, with older versions also available, dating back to 1.0.0.\u003c/p\u003e\n"],["\u003cp\u003eThis \u003ccode\u003eOAuthToken\u003c/code\u003e class is used to generate OAuth tokens for authorizing calls to Google APIs, typically those hosted on *.googleapis.com.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eOAuthToken\u003c/code\u003e requires a service account email and optional OAuth scope to create authorization tokens, as it is a class containing the information needed to generate an OAuth token.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eScope\u003c/code\u003e property in the \u003ccode\u003eOAuthToken\u003c/code\u003e class specifies the OAuth scope for generating the access token, defaulting to "\u003ca href=\"https://www.googleapis.com/auth/cloud-platform\"\u003ehttps://www.googleapis.com/auth/cloud-platform\u003c/a\u003e" if not specified.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eServiceAccount\u003c/code\u003e property is required, and it specifies the service account email used to create the OAuth token, requiring the caller to have \u003ccode\u003eiam.serviceAccounts.actAs\u003c/code\u003e permission.\u003c/p\u003e\n"]]],[],null,["# Eventarc v1 API - Class Pipeline.Types.Destination.Types.AuthenticationConfig.Types.OAuthToken (2.6.0)\n\nVersion latestkeyboard_arrow_down\n\n- [2.6.0 (latest)](/dotnet/docs/reference/Google.Cloud.Eventarc.V1/latest/Google.Cloud.Eventarc.V1.Pipeline.Types.Destination.Types.AuthenticationConfig.Types.OAuthToken)\n- [2.5.0](/dotnet/docs/reference/Google.Cloud.Eventarc.V1/2.5.0/Google.Cloud.Eventarc.V1.Pipeline.Types.Destination.Types.AuthenticationConfig.Types.OAuthToken)\n- [2.4.0](/dotnet/docs/reference/Google.Cloud.Eventarc.V1/2.4.0/Google.Cloud.Eventarc.V1.Pipeline.Types.Destination.Types.AuthenticationConfig.Types.OAuthToken)\n- [2.3.0](/dotnet/docs/reference/Google.Cloud.Eventarc.V1/2.3.0/Google.Cloud.Eventarc.V1.Pipeline.Types.Destination.Types.AuthenticationConfig.Types.OAuthToken)\n- [2.2.0](/dotnet/docs/reference/Google.Cloud.Eventarc.V1/2.2.0/Google.Cloud.Eventarc.V1.Pipeline.Types.Destination.Types.AuthenticationConfig.Types.OAuthToken)\n- [2.1.0](/dotnet/docs/reference/Google.Cloud.Eventarc.V1/2.1.0/Google.Cloud.Eventarc.V1.Pipeline.Types.Destination.Types.AuthenticationConfig.Types.OAuthToken)\n- [2.0.0](/dotnet/docs/reference/Google.Cloud.Eventarc.V1/2.0.0/Google.Cloud.Eventarc.V1.Pipeline.Types.Destination.Types.AuthenticationConfig.Types.OAuthToken)\n- [1.3.0](/dotnet/docs/reference/Google.Cloud.Eventarc.V1/1.3.0/Google.Cloud.Eventarc.V1.Pipeline.Types.Destination.Types.AuthenticationConfig.Types.OAuthToken)\n- [1.2.0](/dotnet/docs/reference/Google.Cloud.Eventarc.V1/1.2.0/Google.Cloud.Eventarc.V1.Pipeline.Types.Destination.Types.AuthenticationConfig.Types.OAuthToken)\n- [1.1.0](/dotnet/docs/reference/Google.Cloud.Eventarc.V1/1.1.0/Google.Cloud.Eventarc.V1.Pipeline.Types.Destination.Types.AuthenticationConfig.Types.OAuthToken)\n- [1.0.0](/dotnet/docs/reference/Google.Cloud.Eventarc.V1/1.0.0/Google.Cloud.Eventarc.V1.Pipeline.Types.Destination.Types.AuthenticationConfig.Types.OAuthToken) \n\n public sealed class Pipeline.Types.Destination.Types.AuthenticationConfig.Types.OAuthToken : IMessage\u003cPipeline.Types.Destination.Types.AuthenticationConfig.Types.OAuthToken\u003e, IEquatable\u003cPipeline.Types.Destination.Types.AuthenticationConfig.Types.OAuthToken\u003e, IDeepCloneable\u003cPipeline.Types.Destination.Types.AuthenticationConfig.Types.OAuthToken\u003e, IBufferMessage, IMessage\n\nReference documentation and code samples for the Eventarc v1 API class Pipeline.Types.Destination.Types.AuthenticationConfig.Types.OAuthToken.\n\nContains information needed for generating an\n[OAuth token](https://developers.google.com/identity/protocols/OAuth2).\nThis type of authorization should generally only be used when calling\nGoogle APIs hosted on \\*.googleapis.com. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e Pipeline.Types.Destination.Types.AuthenticationConfig.Types.OAuthToken \n\nImplements\n----------\n\n[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[Pipeline](/dotnet/docs/reference/Google.Cloud.Eventarc.V1/latest/Google.Cloud.Eventarc.V1.Pipeline)[Types](/dotnet/docs/reference/Google.Cloud.Eventarc.V1/latest/Google.Cloud.Eventarc.V1.Pipeline.Types)[Destination](/dotnet/docs/reference/Google.Cloud.Eventarc.V1/latest/Google.Cloud.Eventarc.V1.Pipeline.Types.Destination)[Types](/dotnet/docs/reference/Google.Cloud.Eventarc.V1/latest/Google.Cloud.Eventarc.V1.Pipeline.Types.Destination.Types)[AuthenticationConfig](/dotnet/docs/reference/Google.Cloud.Eventarc.V1/latest/Google.Cloud.Eventarc.V1.Pipeline.Types.Destination.Types.AuthenticationConfig)[Types](/dotnet/docs/reference/Google.Cloud.Eventarc.V1/latest/Google.Cloud.Eventarc.V1.Pipeline.Types.Destination.Types.AuthenticationConfig.Types)[OAuthToken](/dotnet/docs/reference/Google.Cloud.Eventarc.V1/latest/Google.Cloud.Eventarc.V1.Pipeline.Types.Destination.Types.AuthenticationConfig.Types.OAuthToken), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[Pipeline](/dotnet/docs/reference/Google.Cloud.Eventarc.V1/latest/Google.Cloud.Eventarc.V1.Pipeline)[Types](/dotnet/docs/reference/Google.Cloud.Eventarc.V1/latest/Google.Cloud.Eventarc.V1.Pipeline.Types)[Destination](/dotnet/docs/reference/Google.Cloud.Eventarc.V1/latest/Google.Cloud.Eventarc.V1.Pipeline.Types.Destination)[Types](/dotnet/docs/reference/Google.Cloud.Eventarc.V1/latest/Google.Cloud.Eventarc.V1.Pipeline.Types.Destination.Types)[AuthenticationConfig](/dotnet/docs/reference/Google.Cloud.Eventarc.V1/latest/Google.Cloud.Eventarc.V1.Pipeline.Types.Destination.Types.AuthenticationConfig)[Types](/dotnet/docs/reference/Google.Cloud.Eventarc.V1/latest/Google.Cloud.Eventarc.V1.Pipeline.Types.Destination.Types.AuthenticationConfig.Types)[OAuthToken](/dotnet/docs/reference/Google.Cloud.Eventarc.V1/latest/Google.Cloud.Eventarc.V1.Pipeline.Types.Destination.Types.AuthenticationConfig.Types.OAuthToken), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[Pipeline](/dotnet/docs/reference/Google.Cloud.Eventarc.V1/latest/Google.Cloud.Eventarc.V1.Pipeline)[Types](/dotnet/docs/reference/Google.Cloud.Eventarc.V1/latest/Google.Cloud.Eventarc.V1.Pipeline.Types)[Destination](/dotnet/docs/reference/Google.Cloud.Eventarc.V1/latest/Google.Cloud.Eventarc.V1.Pipeline.Types.Destination)[Types](/dotnet/docs/reference/Google.Cloud.Eventarc.V1/latest/Google.Cloud.Eventarc.V1.Pipeline.Types.Destination.Types)[AuthenticationConfig](/dotnet/docs/reference/Google.Cloud.Eventarc.V1/latest/Google.Cloud.Eventarc.V1.Pipeline.Types.Destination.Types.AuthenticationConfig)[Types](/dotnet/docs/reference/Google.Cloud.Eventarc.V1/latest/Google.Cloud.Eventarc.V1.Pipeline.Types.Destination.Types.AuthenticationConfig.Types)[OAuthToken](/dotnet/docs/reference/Google.Cloud.Eventarc.V1/latest/Google.Cloud.Eventarc.V1.Pipeline.Types.Destination.Types.AuthenticationConfig.Types.OAuthToken), [IBufferMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.html), [IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.html) \n\nInherited Members\n-----------------\n\n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\nNamespace\n---------\n\n[Google.Cloud.Eventarc.V1](/dotnet/docs/reference/Google.Cloud.Eventarc.V1/latest/Google.Cloud.Eventarc.V1)\n\nAssembly\n--------\n\nGoogle.Cloud.Eventarc.V1.dll\n\nConstructors\n------------\n\n### OAuthToken()\n\n public OAuthToken()\n\n### OAuthToken(OAuthToken)\n\n public OAuthToken(Pipeline.Types.Destination.Types.AuthenticationConfig.Types.OAuthToken other)\n\nProperties\n----------\n\n### Scope\n\n public string Scope { get; set; }\n\nOptional. OAuth scope to be used for generating OAuth access token.\nIf not specified, \"\u003chttps://www.googleapis.com/auth/cloud-platform\u003e\"\nwill be used.\n\n### ServiceAccount\n\n public string ServiceAccount { get; set; }\n\nRequired. Service account email used to generate the [OAuth\ntoken](https://developers.google.com/identity/protocols/OAuth2).\nThe principal who calls this API must have\niam.serviceAccounts.actAs permission in the service account. See\n\u003chttps://cloud.google.com/iam/docs/understanding-service-accounts?hl=en#sa_common\u003e\nfor more information. Eventarc service agents must have\nroles/roles/iam.serviceAccountTokenCreator role to allow Pipeline\nto create OAuth2 tokens for authenticated requests.\n\n### ServiceAccountAsServiceAccountName\n\n public ServiceAccountName ServiceAccountAsServiceAccountName { get; set; }\n\n[ServiceAccountName](/dotnet/docs/reference/Google.Cloud.Eventarc.V1/latest/Google.Cloud.Eventarc.V1.ServiceAccountName)-typed view over the [ServiceAccount](/dotnet/docs/reference/Google.Cloud.Eventarc.V1/latest/Google.Cloud.Eventarc.V1.Pipeline.Types.Destination.Types.AuthenticationConfig.Types.OAuthToken#Google_Cloud_Eventarc_V1_Pipeline_Types_Destination_Types_AuthenticationConfig_Types_OAuthToken_ServiceAccount)\nresource name property."]]