
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
n8n-nodes-credentials-google-identity-token
Advanced tools
n8n community credential for Google Cloud Identity Token authentication - enables secure access to Cloud Run and Cloud Functions
Custom n8n credential for authenticating to Google Cloud services that require Identity Tokens (such as Cloud Run and Cloud Functions).
The default Google Cloud credential in n8n generates Access Tokens, which are used to access Google APIs like Cloud Storage, BigQuery, etc. However, some Google Cloud services require Identity Tokens for authentication:
| Feature | Access Token | Identity Token |
|---|---|---|
| Purpose | Access Google APIs | Prove identity to a service |
| Contains | OAuth scopes | Audience (aud claim) |
| Verified by | Google servers | Target service |
| Format | Opaque or JWT | Always JWT |
| Use case | Call GCP APIs | Call your protected services |
This credential generates proper Identity Tokens using your service account, allowing n8n to authenticate to services that require them.
Authorization: Bearer <token> headerInstall as a community node package:
# For global n8n installation
npm install -g n8n-credentials-google-identity-token
# For local n8n installation
npm install n8n-credentials-google-identity-token
# Then restart n8n
n8n start
With Docker:
# docker-compose.yml
version: '3.8'
services:
n8n:
image: n8nio/n8n
ports:
- "5678:5678"
environment:
- N8N_COMMUNITY_PACKAGES=n8n-credentials-google-identity-token
volumes:
- n8n_data:/home/node/.n8n
Or use environment variable:
docker run -it --rm \
-e N8N_COMMUNITY_PACKAGES=n8n-credentials-google-identity-token \
-p 5678:5678 \
n8nio/n8n
Via n8n Interface:
n8n-credentials-google-identity-token📚 Detailed installation guide: See INSTALL_COMMUNITY_NODE.md for complete instructions and troubleshooting.
Copy the credential file to your n8n custom directory:
# Create credentials directory if it doesn't exist
mkdir -p ~/.n8n/custom/credentials
# Copy the credential file
cp credentials/GoogleCloudIdentityToken.credentials.ts ~/.n8n/custom/credentials/
Restart n8n:
# If running locally
n8n restart
# If using Docker
docker restart <n8n-container-name>
Verify installation:
# Install to default location
./install.sh
# Or specify custom path
./install.sh /path/to/n8n/custom
https://your-service-xyz.run.app)Authorization: Bearer <identity-token> header1. HTTP Request node:
- Method: GET
- URL: https://my-service-xyz.run.app/api/data
- Authentication: Google Cloud Identity Token
- Credential: [Your configured credential]
2. Target Audience in credential: https://my-service-xyz.run.app
1. HTTP Request node:
- Method: POST
- URL: https://us-central1-myproject.cloudfunctions.net/myfunction
- Authentication: Google Cloud Identity Token
- Credential: [Your configured credential]
2. Target Audience: https://us-central1-myproject.cloudfunctions.net/myfunction
If you need to call multiple protected services, create separate credentials for each with different target audiences:
https://service-a.run.apphttps://service-b.run.apphttps://us-central1-project.cloudfunctions.net/funcYour service account needs the following IAM role to invoke protected services:
gcloud projects add-iam-policy-binding PROJECT_ID \
--member="serviceAccount:SERVICE_ACCOUNT_EMAIL" \
--role="roles/run.invoker"
gcloud projects add-iam-policy-binding PROJECT_ID \
--member="serviceAccount:SERVICE_ACCOUNT_EMAIL" \
--role="roles/cloudfunctions.invoker"
# Test with gcloud
gcloud auth print-identity-token \
--audiences=https://your-service.run.app \
--impersonate-service-account=your-sa@project.iam.gserviceaccount.com
Cause: The service account JSON is malformed or incomplete.
Solution:
Cause: Service account doesn't have invoker permission.
Solution:
# Grant the role
gcloud run services add-iam-policy-binding SERVICE_NAME \
--member="serviceAccount:SA_EMAIL" \
--role="roles/run.invoker"
Cause: Target audience doesn't match the service URL.
Solution:
Symptoms: 401 Unauthorized or 403 Forbidden
Debug steps:
Test with gcloud CLI:
TOKEN=$(gcloud auth print-identity-token \
--audiences=https://your-service.run.app)
curl -H "Authorization: Bearer $TOKEN" \
https://your-service.run.app
Decode the token to check claims:
echo $TOKEN | cut -d. -f2 | base64 -d | jq
Verify the aud claim matches your service URL
Issue: Using v2 credential and tokens seem stale.
Solution:
This package includes two versions:
GoogleCloudIdentityToken.credentials.ts)GoogleCloudIdentityToken.credentials.v2.ts)See VERSIONS.md for detailed comparison.
┌─────────┐ ┌──────────────┐ ┌─────────────┐
│ n8n │ 1. Create │ This │ 2. Request │ Google │
│ HTTP │──────JWT────▶ │ Credential │──────token───▶ │ OAuth │
│ Request │ │ │ │ Server │
└─────────┘ └──────────────┘ └─────────────┘
│ │ │
│ │ 3. Receive Identity Token │
│ │◀──────────────────────────────┘
│ │
│ 4. Add Authorization │
│◀───────header──────────────┘
│
│ 5. Make authenticated request
└──────────────────────────────────────▶ Protected Service
authenticate() methodiss and sub: service account emailaud: Google OAuth endpointtarget_audience: your service URLAuthorization: Bearer <token> header{
"iss": "https://accounts.google.com",
"sub": "103584029384756284756",
"aud": "https://your-service.run.app",
"iat": 1234567890,
"exp": 1234571490,
"email": "my-sa@my-project.iam.gserviceaccount.com",
"email_verified": true
}
Q: Can I use this with the default Google Cloud credential? A: No, they serve different purposes. Use this for Identity Tokens, the default one for Access Tokens to Google APIs.
Q: How long do Identity Tokens last? A: Tokens are valid for 1 hour. The credential generates them on-demand.
Q: Does this work with Cloud Storage or BigQuery? A: No, those services require Access Tokens. Use the default Google Cloud credential for those.
Q: Can I use this outside of n8n? A: This is specifically built for n8n, but the logic can be adapted for other use cases.
Q: Is the cached version safe? A: Yes, tokens are cached in-memory only and expire after 50 minutes. The cache is cleared when n8n restarts.
Q: Can I use this with Workload Identity? A: Not directly. This requires a service account JSON key. For Workload Identity, you'd need a different approach.
Contributions are welcome! Please:
MIT License - see LICENSE file for details.
FAQs
n8n community credential for Google Cloud Identity Token authentication - enables secure access to Cloud Run and Cloud Functions
We found that n8n-nodes-credentials-google-identity-token demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.