> ## Documentation Index
> Fetch the complete documentation index at: https://ona.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Get OIDC Config

> Retrieves the OIDC token configuration for an organization.

`Unary` · [`Organizations`](https://ona.com/docs/api-reference/generated/organization/overview)

Retrieves the OIDC token configuration for an organization.

Use this method to:

* Check which OIDC token version is active (V2 or V3)
* View extra sub claim fields (V3 only)

### Examples

* Get OIDC config:

  ```yaml theme={null}
  organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047"
  ```

## Endpoint

```text theme={null}
POST /api/gitpod.v1.OrganizationService/GetOIDCConfig
```

Send a Bearer token as described in [Authentication](https://ona.com/docs/api-reference.md#authenticate-requests). If your organization uses a custom management-plane domain, replace `https://app.ona.com` with that domain.

## Request example

```bash cURL theme={null}
export ONA_HOST=https://app.ona.com
export ONA_API_KEY=<your-token>

curl --request POST \
  --url "$ONA_HOST/api/gitpod.v1.OrganizationService/GetOIDCConfig" \
  --header "Authorization: Bearer $ONA_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{
  "organizationId": "<organization-id>"
}'
```

```python Python theme={null}
import gitpod.v1.organization_pb2 as organization_pb2
from ona_sdk import create_client_from_env

ona = create_client_from_env()
request = organization_pb2.GetOIDCConfigRequest(
    organization_id="<organization-id>",
)
response = ona.services.organization.get_oidc_config(request)
print(response)
```

```typescript TypeScript theme={null}
import { create } from "@bufbuild/protobuf";
import { createClientFromEnv } from "@gitpod/sdk";
import { GetOIDCConfigRequestSchema } from "@gitpod/sdk/gitpod/v1/organization_pb";

async function main() {
  const ona = createClientFromEnv();
  const request = create(GetOIDCConfigRequestSchema, {
    organizationId: "<organization-id>",
  });
  const response = await ona.services.organization.getOIDCConfig(request);
  console.log(response);
}

main().catch(console.error);
```

```go Go theme={null}
package main

import (
	"context"
	"fmt"
	"log"

	"connectrpc.com/connect"
	"github.com/gitpod-io/gitpod-sdk-go/sdk"
	gitpodpb "github.com/gitpod-io/gitpod-sdk-go/v1"
)

func main() {
	ona, err := sdk.NewFromEnv()
	if err != nil {
		log.Fatal(err)
	}

	request := connect.NewRequest(&gitpodpb.GetOIDCConfigRequest{
		OrganizationId: "<organization-id>",
	})
	response, err := ona.Services.Organization.GetOIDCConfig(context.Background(), request)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(response.Msg)
}
```

```json Request body theme={null}
{
  "organizationId": "<organization-id>"
}
```

## Request

`gitpod.v1.GetOIDCConfigRequest`

GetOIDCConfigRequest is the request message for retrieving OIDC token configuration.

| Field | Type | Required | Description |
| - | - | - | - |
| `organizationId` | string | Yes | organization\_id is the ID of the organization. Constraints: `required=true, string.uuid=true`. |

## Response

`gitpod.v1.GetOIDCConfigResponse`

GetOIDCConfigResponse is the response message for retrieving OIDC token configuration.

| Field | Type | Required | Description |
| - | - | - | - |
| `oidcConfig` | [OIDCConfig](#type-gitpod-v1-oidc-config) | Yes | oidc\_config is the current OIDC token configuration. Constraints: `required=true`. |

## Related types

> [accordion] OIDCConfig
>
> OIDCConfig represents the OIDC token configuration for an organization.
> The version oneof determines which token version is active.
>
> `gitpod.v1.OIDCConfig`
>
> | Field | Type | Required | Description |
> | - | - | - | - |
> | `v2` | [OIDCConfigV2](#type-gitpod-v1-oidc-config-v2) | One of `version` | v2 selects V2 OIDC tokens. |
> | `v3` | [OIDCConfigV3](#type-gitpod-v1-oidc-config-v3) | One of `version` | v3 selects V3 OIDC tokens with richer claims and optional sub claim customization (the default for new organizations). |

> [accordion] OIDCConfigV2
>
> OIDCConfigV2 configures V2 OIDC tokens. No additional parameters.
>
> `gitpod.v1.OIDCConfigV2`
>
> This message has no fields.

> [accordion] OIDCConfigV3
>
> OIDCConfigV3 configures V3 OIDC tokens with optional sub claim customization.
>
> `gitpod.v1.OIDCConfigV3`
>
> | Field | Type | Required | Description |
> | - | - | - | - |
> | `extraSubFields` | array of string | No | extra\_sub\_fields are additional property keys to include in the sub claim. Valid keys include: account\_id, user\_id, organization\_id, project\_id, runner\_id, environment\_id, creator\_id, creator\_principal, creator\_email, creator\_name, creator\_idp, email, name, idp, runner\_name, service\_account\_id, and dot-notation keys like creator\_idp\_claims.groups or idp\_claims.department. Constraints: `repeated.items.string.min_len=1, repeated.max_items=50, repeated.unique=true`. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.