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."],[[["\u003cp\u003eThis webpage details the \u003ccode\u003eRequestExtensions\u003c/code\u003e class, which provides extension methods for managing requests within the Google.Apis.Auth.OAuth2 namespace.\u003c/p\u003e\n"],["\u003cp\u003eThe class is located in the \u003ccode\u003eGoogle.Apis.Auth.dll\u003c/code\u003e assembly and inherits from the base \u003ccode\u003eobject\u003c/code\u003e class.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eAddCredential<T>\u003c/code\u003e method, an extension method, enables adding a specific credential to a request, overriding any service-level credentials.\u003c/p\u003e\n"],["\u003cp\u003eMultiple previous versions of the api are accessible from this page, with the most recent being version 1.69.0.\u003c/p\u003e\n"],["\u003cp\u003eThere is a detailed list of inherited methods from the parent object class, including \u003ccode\u003eEquals\u003c/code\u003e, \u003ccode\u003eGetHashCode\u003c/code\u003e, \u003ccode\u003eGetType\u003c/code\u003e and others.\u003c/p\u003e\n"]]],[],null,[]]