---
title: "POST /v1/projects/{projectsId}/locations/{locationsId}/authProviders/{authProvidersId}:enable"
method: POST
path: "/v1/projects/{projectsId}/locations/{locationsId}/authProviders/{authProvidersId}:enable"
tags: ["projects"]
---

# POST /v1/projects/{projectsId}/locations/{locationsId}/authProviders/{authProvidersId}:enable

`POST /v1/projects/{projectsId}/locations/{locationsId}/authProviders/{authProvidersId}:enable`

## Request

- Base URL: `https://agentidentity.googleapis.com`
- URL: `https://agentidentity.googleapis.com/v1/projects/{projectsId}/locations/{locationsId}/authProviders/{authProvidersId}:enable`
- Auth: OAuth 2 and OAuth 2
  - Implicit: `https://accounts.google.com/o/oauth2/auth`
  - Scopes: `https://www.googleapis.com/auth/cloud-platform`
  - Authorization code: `https://accounts.google.com/o/oauth2/auth`
  - Token URL: `https://accounts.google.com/o/oauth2/token` scopes: `https://www.googleapis.com/auth/cloud-platform`

Enables a single auth provider.

## Path parameters

- `projectsId` string, required
- `locationsId` string, required
- `authProvidersId` string, required

## Query parameters

- `$.xgafv` '1' | '2'
- `access_token` string
- `alt` 'json' | 'media' | 'proto'
- `callback` string
- `fields` string
- `key` string
- `oauth_token` string
- `prettyPrint` boolean
- `quotaUser` string
- `uploadType` string
- `upload_protocol` string

## Request body

- EnableAuthProviderRequest: Request message for `EnableAuthProvider`.
  - `requestId` string: Optional. An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes after the first request. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

## Response `200`

Successful response

- AuthProvider: Represents an auth provider.
  - `allowedScopes` string[]: Optional. List of scopes that are allowed to be requested for this auth provider. If this list is non-empty, only scopes within this list may be requested. If this list is empty, all scopes may be requested. Scopes appearing in `blocked_scopes` are disallowed even if they appear in `allowed_scopes`. The number of allowed scopes is limited to 200.
  - `authProviderTypeParams` AuthProviderTypeParams: Required. Parameters specific to the auth provider type.
    - `apiKey` ApiKeyParams: Configuration for API key authentication.
      - `apiKey` string: Optional. Input only. The API key for this auth provider.
    - `connectorReferenceAuthProvider` ConnectorReferenceAuthProvider: Configuration parameters for the Connector Reference auth provider.
      - `authorizationDetails` object[]: Optional. Rich Authorization Requests (RFC 9396) detailing targeted OAuth resources/scopes, formatted as a JSON array of JSON objects.
      - `connector` string: Required. The name of the referenced connector.
    - `geAuthProvider` GeminiEnterpriseAuthProviderParams: Configuration for Gemini Enterprise authentication.
    - `threeLeggedOauth` ThreeLeggedOAuth: Configuration for 3-legged OAuth (3LO) authentication.
      - `authorizationUrl` string: Optional. The authorization endpoint to send users to for consenting to delegate to the agent. For example, "https://auth.atlassian.com/authorize".
      - `clientId` string: Optional. The client ID of the OAuth client.
      - `clientSecret` string: Optional. Input only. The client secret of the OAuth client.
      - `defaultContinueUri` string: Optional. The default continue URI for the 3LO flow, used when no continue URI is provided in the RetrieveCredentials request.
      - `enablePkce` boolean: Optional. Enables Proof Key for Code Exchange (PKCE) for the OAuth flow to prevent authorization code interception attacks.
      - `redirectUrl` string: Output only. The redirect URL this auth provider uses for the OAuth exchange. This is deterministic based on the name of the auth provider.
      - `tokenUrl` string: Optional. The token endpoint for requesting tokens on behalf of an end user. For example, "https://auth.atlassian.com/oauth/token".
    - `twoLeggedOauth` TwoLeggedOAuth: Configuration for 2-legged OAuth (2LO) authentication.
      - `clientId` string: Optional. The client ID of the OAuth client.
      - `clientSecret` string: Optional. Input only. The client secret of the OAuth client.
      - `tokenUrl` string: Optional. The token endpoint of the OAuth client.
    - `xaaAuthProvider` CrossAppAccessAuthProvider: Configuration parameters for the Cross-App Access auth provider.
      - `additionalParameters` object: Optional. Additional parameters to be passed to the token endpoint.
      - `clientAssertionJwtAuth` ClientAssertionJwtAuth: Configuration for client ID and client assertion JWT authentication.
        - `clientId` string: Required. The client identifier.
      - `clientSecretAuth` ClientSecretAuth: Configuration for client ID and client secret authentication.
        - `clientId` string: Required. The client identifier.
        - `clientSecret` string: Required. Input only. The client secret.
      - `customIssuer` CustomIssuer: Configuration for a custom or third-party authorization server issuer.
        - `issuer` string: Optional. The issuer identifier of the target Authorization Server.
        - `tokenUrl` string: Required. The token endpoint of the target OAuth authorization server to retrieve resource tokens.
      - `googleAccount` GoogleAccount: Configuration for Google Account usage as the issuer.
      - `idJagInput` DirectIdJagInput: Marker message indicating the input is already an ID-JAG, so no fetching is required.
      - `idTokenInput` IdTokenProcessingConfig: Defines how to process an input ID token to obtain an ID-JAG.
        - `agentIdentityPool` AgentIdentityPool: Marker message to indicate the managed Agent Identity Pool is used.
        - `idJagAdditionalClaims` object: Optional. Optional additional claims to include when fetching an ID-JAG.
        - `idJagAuthProvider` string: The resource name of the ID-JAG auth provider. Format: "projects/{project}/locations/{location}/authProviders/{auth_provider}"
      - `workforceIdentityFederation` WorkforceIdentityFederation: Configuration for Workforce Identity Federation usage as the issuer.
  - `blockedScopes` string[]: Optional. List of scopes that are blocked from being requested for this auth provider. If a scope appears in this list, it will not be requested, even if it also appears in `allowed_scopes`. `blocked_scopes` takes precedence over `allowed_scopes`. The number of blocked scopes is limited to 200.
  - `createTime` string, google-datetime: Output only. The creation timestamp.
  - `deleted` boolean: Output only. Set to `true` if the auth provider is deleted.
  - `description` string: Optional. Description of the resource. Must be less than 256 characters.
  - `expireTime` string, google-datetime: Output only. The time when the auth provider will expire.
  - `labels` object: Optional. Labels as key-value pairs.
  - `name` string: Identifier. The full resource name of the auth provider. Format: projects/{project}/locations/{location}/authProviders/{auth_provider}
  - `state` 'STATE_UNSPECIFIED' | 'ENABLED' | 'DISABLED': Output only. The state of the auth provider.
  - `updateTime` string, google-datetime: Output only. The update timestamp.
  - `workloadIds` string[]: Optional. Input only. Identifiers for the agents that will use this auth provider, starting with `principal://`. For example: `principal://agents.global.org-${ORG_ID}.system.id.goog/resources/aiplatform/projects/{PROJECT_ID}/locations/{LOCATIONS}/reasoningEngines/{ID}`

---

[API](https://skmtc.dev/google/apis/agentidentity.md) - [All operations](https://skmtc.dev/google/apis/agentidentity/llms.txt) - [OpenAPI document](https://skmtc.dev/google/apis/agentidentity/revisions/f532280f07f9?raw)
