public class ComputeCredential.Initializer : ServiceCredential.Initializer
An initializer class for the Compute credential. It uses EffectiveComputeTokenUrl
as the token server URL (optionally overriding the host using the GCE_METADATA_HOST environment variable).
public Initializer(string tokenUrl, string oidcTokenUrl)
Constructs a new initializer using the given token URL
and OIDC token URL (optionally overriding the host using the GCE_METADATA_HOST environment variable).
[[["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\u003eComputeCredential.Initializer\u003c/code\u003e class, which is used to initialize compute credentials for API access.\u003c/p\u003e\n"],["\u003cp\u003eThe initializer leverages \u003ccode\u003eEffectiveComputeTokenUrl\u003c/code\u003e as the token server URL, with the ability to override the host through the \u003ccode\u003eGCE_METADATA_HOST\u003c/code\u003e environment variable.\u003c/p\u003e\n"],["\u003cp\u003eThere are three constructors available, allowing initialization with default settings, a custom token URL, or both a custom token URL and OIDC token URL.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eOidcTokenUrl\u003c/code\u003e property provides access to the OIDC token URL being utilized by the initializer.\u003c/p\u003e\n"],["\u003cp\u003eThe page offers documentation for various versions, with the latest being 1.69.0 and going as far back as version 1.50.0.\u003c/p\u003e\n"]]],[],null,[]]