---
title: "Create OIDC provider"
method: POST
path: "/databases/{databaseId}/auth/oidc/providers"
tags: ["authentication"]
---

# Create OIDC provider

`POST /databases/{databaseId}/auth/oidc/providers`

## Request

- Base URL: `https://global.thenile.dev`
- URL: `https://global.thenile.dev/databases/{databaseId}/auth/oidc/providers`
- Auth: HTTP bearer

Creates an OIDC provider with the database. During creation, the well-known configuration is loaded from the `configUrl` and stored in the database. 
Google and Okta are supported out of the box. Use this endpoint to register other OIDC providers.

## Path parameters

- `databaseId` string, required

## Request body

- OIDCProvider
  - `name` string, required
  - `authType` 'SSO' | 'SOCIAL', required
  - `redirectUrl` string, uri
  - `enabled` boolean
  - `configUrl` string, uri
  - `config` JsonNode
  - `ttl_sec` integer

## Response `200`

Updated OIDC provider

- OIDCProvider
  - `name` string, required
  - `authType` 'SSO' | 'SOCIAL', required
  - `redirectUrl` string, uri
  - `enabled` boolean
  - `configUrl` string, uri
  - `config` JsonNode
  - `ttl_sec` integer

## Other responses

- `401`: Unauthorized
- `409`: OIDC provider already exists
- `502`: OIDC provider configuration does not match host URL

---

[API](https://skmtc.dev/thenile/apis/nile-rest-api.md) · [All operations](https://skmtc.dev/thenile/apis/nile-rest-api/llms.txt) · [OpenAPI document](https://skmtc.dev/thenile/apis/nile-rest-api/revisions/afe849f2aeec?raw)
