---
search:
  tags:
    - settings
    - PUT
seo:
  description: >-
    Applies at once, with no restart. When a save turns SSO on or changes…
    Reference for the PUT /api/v1/settings/oidc endpoint in the TimescaleDB
    Enterprise API.
sidebar:
  label: Set single sign-on settings
  badge: PUT
title: Set single sign-on settings
type: openapi-operation
---
Applies at once, with no restart. When a save turns SSO on or changes the issuer URL, the client ID or the client secret, the console must read the discovery document of the issuer, and the client secret must be readable. Other saves do not contact the identity provider. An empty client_secret keeps the stored secret, also one that is unreadable. Local login can be off only while SSO is on, and to turn SSO off turns local login on. Only an SSO session or the admin token can turn local login off; that ends the sessions of the local users.

`PUT /api/v1/settings/oidc`

**Request body** (`application/json`, required)

- `admin_groups` (string[])
- `allow_local_login` (boolean, required) — To turn SSO off turns local login on
- `client_id` (string)
- `client_secret` (string) — Empty keeps the stored secret
- `default_role` (string) — none, viewer, operator or admin
- `enabled` (boolean, required)
- `issuer_url` (string)
- `operator_groups` (string[])
- `role_claim` (string) — Empty: groups
- `viewer_groups` (string[])

Request body example:

```json
{
  "admin_groups": [
    "string"
  ],
  "allow_local_login": true,
  "client_id": "string",
  "client_secret": "string",
  "default_role": "string",
  "enabled": true,
  "issuer_url": "string",
  "operator_groups": [
    "string"
  ],
  "role_claim": "string",
  "viewer_groups": [
    "string"
  ]
}
```

**Responses**

- `200` — OK
- `default` — Error

Response example, 200:

```json
{
  "admin_groups": [
    "string"
  ],
  "allow_local_login": true,
  "client_id": "string",
  "client_secret_state": "set",
  "default_role": "none",
  "enabled": true,
  "issuer_url": "string",
  "local_login_lock_reason": "string",
  "operator_groups": [
    "string"
  ],
  "redirect_uri": "string",
  "role_claim": "string",
  "viewer_groups": [
    "string"
  ]
}
```
