public static T AddCredential<T>(this T request, ICredential credential) where T : ClientServiceRequest
Add a credential that is used for this request only.
This will override a service-level credential (if there is one).
Do not call more than once per request instance, as each call incrementally adds the provided credential.
To perform identical requests but with distinct credentials, create a separate request instance for each credential.
Parameters
Name
Description
request
T
The request which requires a credential. Must not be null.
[[["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."],[[["The `RequestExtensions` class provides extension methods for requests within the `Google.Apis.Auth.OAuth2` namespace, enabling enhanced functionality."],["This class inherits from `object` and includes methods such as `Equals`, `GetHashCode`, and `ToString`, among others, that are inherited from the base object type."],["The primary method, `AddCredential\u003cT\u003e(T, ICredential)`, allows adding a specific credential to a request, which overrides any service-level credentials."],["The `AddCredential` method must only be called once per request instance, and distinct credentials require separate request instances."],["This class is contained in the Google.Apis.Auth.dll, and version information ranges from 1.50.0 to 1.69.0, with 1.69.0 being the latest."]]],[]]