Retrieves the project ID corresponding to the workload identity or workforce pool.
For workforce pool credentials, it returns the project ID corresponding to the workforce_pool_user_project.
When not determinable, None is returned.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-09 UTC."],[],[],null,["# googleauth - Module Google::Auth::ExternalAccount::ExternalAccountUtils (v1.15.0)\n\nVersion latestkeyboard_arrow_down\n\n- [1.15.0 (latest)](/ruby/docs/reference/googleauth/latest/Google-Auth-ExternalAccount-ExternalAccountUtils)\n- [1.14.0](/ruby/docs/reference/googleauth/1.14.0/Google-Auth-ExternalAccount-ExternalAccountUtils)\n- [1.13.1](/ruby/docs/reference/googleauth/1.13.1/Google-Auth-ExternalAccount-ExternalAccountUtils)\n- [1.12.2](/ruby/docs/reference/googleauth/1.12.2/Google-Auth-ExternalAccount-ExternalAccountUtils) \nReference documentation and code samples for the googleauth module Google::Auth::ExternalAccount::ExternalAccountUtils.\n\nAuthenticates requests using External Account credentials, such\nas those provided by the AWS provider or OIDC provider like Azure, etc.\n\nMethods\n-------\n\n### #normalize_timestamp\n\n def normalize_timestamp(time) -\u003e Time, nil\n\nNormalizes a timestamp value to a Time object \n**Parameter**\n\n- **time** (Time, String, nil) --- The timestamp to normalize \n**Returns**\n\n- (Time, nil) --- The normalized timestamp or nil if input is nil \n**Raises**\n\n- ([Google::Auth::CredentialsError](./Google-Auth-CredentialsError)) --- If the time value is not nil, Time, or String\n\n### #project_id\n\n def project_id() -\u003e String, nil\n\nRetrieves the project ID corresponding to the workload identity or workforce pool.\nFor workforce pool credentials, it returns the project ID corresponding to the workforce_pool_user_project.\nWhen not determinable, None is returned.\n\n\n\u003cbr /\u003e\n\nThe resource may not have permission (resourcemanager.projects.get) to\ncall this API or the required scopes may not be selected:\n\u003chttps://cloud.google.com/resource-manager/reference/rest/v1/projects/get#authorization-scopes\u003e \n**Returns**\n\n- (String, nil) --- The project ID corresponding to the workload identity pool or workforce pool if determinable\n\n### #project_number\n\n def project_number() -\u003e String, nil\n\nRetrieve the project number corresponding to workload identity pool\nSTS audience pattern:\n`//iam.googleapis.com/projects/$PROJECT_NUMBER/locations/...` \n**Returns**\n\n- (String, nil) --- The project number extracted from the audience string, or nil if it cannot be determined\n\n### #service_account_email\n\n def service_account_email() -\u003e String, nil\n\nExtracts the service account email from the impersonation URL \n**Returns**\n\n- (String, nil) --- The service account email extracted from the service_account_impersonation_url, or nil if it cannot be determined\n\nConstants\n---------\n\n### CLOUD_RESOURCE_MANAGER\n\n**value:** \"\u003chttps://cloudresourcemanager.googleapis.com/v1/projects/\".freeze\u003e \nCloud resource manager URL used to retrieve project information."]]