Skip to content

GCP.AgentIdentity reference

Source: src/GCP/AgentIdentity/AuthProvider.ts

An Agent Identity auth provider — the credential configuration agents use to call third-party APIs (API keys, 2LO, or 3LO OAuth).

authProviderId and location replace the resource. Description, labels, scopes, type parameters, and enabled/disabled update in place.

API key

const auth = yield* GCP.AgentIdentity.AuthProvider("Maps", {
authProviderTypeParams: {
apiKey: { apiKey: "maps-api-key" },
},
labels: { env: "prod" },
});

Three-legged OAuth

const auth = yield* GCP.AgentIdentity.AuthProvider("Atlassian", {
authProviderTypeParams: {
threeLeggedOauth: {
clientId: "jira-client",
clientSecret: "jira-secret",
authorizationUrl: "https://auth.atlassian.com/authorize",
tokenUrl: "https://auth.atlassian.com/oauth/token",
enablePkce: true,
},
},
allowedScopes: ["read:jira-work"],
labels: { env: "prod" },
});
const auth = yield* GCP.AgentIdentity.AuthProvider("Maps", {
authProviderId: "maps",
authProviderTypeParams: {
apiKey: { apiKey: "maps-api-key" },
},
description: "Maps API key for agents",
labels: { env: "prod", role: "maps" },
});