public sealed class OidcToken : IMessage<OidcToken>, IEquatable<OidcToken>, IDeepCloneable<OidcToken>, IBufferMessage, IMessage
Reference documentation and code samples for the Google Cloud Tasks v2 API class OidcToken.
Contains information needed for generating an
OpenID Connect
token.
This type of authorization can be used for many scenarios, including
calling Cloud Run, or endpoints where you intend to validate the token
yourself.
Service account email
to be used for generating OIDC 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"]],[["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\u003eThis webpage provides documentation for the \u003ccode\u003eOidcToken\u003c/code\u003e class within the Google Cloud Tasks v2 API, specifically for version 3.4.0, and includes links to other versions, with 3.5.0 being the latest.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eOidcToken\u003c/code\u003e class is used to generate OpenID Connect tokens, suitable for authorizing access to services like Cloud Run or for endpoints requiring token validation.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eOidcToken\u003c/code\u003e class implements multiple interfaces, including \u003ccode\u003eIMessage\u003c/code\u003e, \u003ccode\u003eIEquatable\u003c/code\u003e, \u003ccode\u003eIDeepCloneable\u003c/code\u003e, and \u003ccode\u003eIBufferMessage\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe class offers two constructors, one default and one that allows for creating a new \u003ccode\u003eOidcToken\u003c/code\u003e from an existing \u003ccode\u003eOidcToken\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe class has two key properties: \u003ccode\u003eAudience\u003c/code\u003e, which defines the intended recipient of the token, and \u003ccode\u003eServiceAccountEmail\u003c/code\u003e, which specifies the service account used to generate the token, with constraints on its project and permissions.\u003c/p\u003e\n"]]],[],null,[]]