# OIDCProvider spec

URL: /docs/develop/security-and-networking/sign-in/spec

Every field of OIDCProvider: its type, its limits and its description.

This page lists the spec and status fields of OIDCProvider, each with its type, its limits and its description. The [Platform page](/docs/platform/security-and-networking/sign-in.md) explains the concept, and the `metadata` of every kind is [the same](/docs/develop/common-definitions.md#objectmeta).

## OIDCProvider [#oidcprovider]

```yaml
apiVersion: funcd.io/v1alpha1
kind: OIDCProvider
metadata:
  name: sso
  namespace: default
  resourceGroup: rg1
spec:
  issuer: http://login.localhost:8080/auth/v1/
  addon: login
  client:
    registration: {}
  sessionSecret: sso-session
```

| apiVersion | kind |
| --- | --- |
| `funcd.io/v1alpha1` | `OIDCProvider` |

### `OIDCProvider.spec` [#oidcproviderspec]

| Field | Type and limits | Description |
| --- | --- | --- |
| `addon` | string, a DNS-1123 label | The add-on object of the namespace that serves the provider: funcd reaches the provider at the engine's own address, while browsers use issuer. |
| `audiences` | array of string values | The aud values a Bearer token may carry to sign a call in. Empty, the default, means that a Bearer token signs nobody in. |
| `client` | object, [`OIDCProvider.spec.client`](#oidcproviderspecclient), required | The sign-in client: set exactly one of registration, a client funcd registers at the provider, and credentialsSecret, a client made by hand. |
| `issuer` | string, required | The provider's issuer URL, as its discovery document names it and as browsers reach it. Without addon, funcd reads the discovery document and every endpoint it names over https only, at addresses reachable from the internet; with addon, at the add-on engine's own address. |
| `sessionSecret` | string, required, a DNS-1123 label | A Secret of the namespace whose SESSION_KEY holds 32 random bytes, the key that seals the sign-in cookies. A new key ends every session of the provider. |

### `OIDCProvider.spec.client` [#oidcproviderspecclient]

| Field | Type and limits | Description |
| --- | --- | --- |
| `credentialsSecret` | string, a DNS-1123 label | A Secret of the namespace, written by hand, whose CLIENT_ID and CLIENT_SECRET hold a client made at the provider. |
| `registration` | object, [`OIDCProvider.spec.client.registration`](#oidcproviderspecclientregistration) | funcd registers the client at the provider's registration endpoint, keeps its redirect URIs on the callbacks of the hosts that sign in with the provider, and writes its credentials to a Secret it owns. |

### `OIDCProvider.spec.client.registration` [#oidcproviderspecclientregistration]

| Field | Type and limits | Description |
| --- | --- | --- |
| `credentialSecretName` | string, a DNS-1123 label | The Secret funcd writes the client to, as CLIENT_ID, CLIENT_SECRET, REGISTRATION_ACCESS_TOKEN and REGISTRATION_CLIENT_URI, and deletes with the provider. Empty means the provider's name. funcd leaves alone a Secret of that name it did not write, and the provider then stays Pending with reason SecretNotOwned. |
| `rotate` | integer, at least 0 | Raise it above status.observedRotate to rotate the client's secret: funcd asks the provider for a new one and stores it. |
| `tokenSecret` | string, a DNS-1123 label | A Secret whose REGISTRATION_TOKEN funcd sends as a Bearer token with every registration, for a provider that requires one. |

### `OIDCProvider.status` [#oidcproviderstatus]

| Field | Type and limits | Description |
| --- | --- | --- |
| `callbacks` | array of string values | The callbacks funcd last applied to the registered client's redirect URIs, sorted. |
| `clientId` | string | The client ID the stored client carries. |
| `conditions` | array of [Condition](/docs/develop/common-definitions.md#condition) | The conditions that explain the phase. |
| `observedGeneration` | integer | The generation of the spec that funcd last acted on. |
| `observedRotate` | integer | The spec.client.registration.rotate value funcd last applied: a rotation is done once it equals rotate. |
| `phase` | string, one of `Pending`, `Deploying`, `Ready`, `Idle`, `Degraded`, `Failed`, `Terminating` | Where the object is in its lifecycle. |

## HTTP API [#http-api]

The table lists each described operation of these kinds, with its method and path. The operation's page in the API reference gives its parameters, its body, its authentication and every answer, with when it happens and what to do.

| Method | Path | Operation |
| --- | --- | --- |
| `GET` | `/apis/funcd.io/v1alpha1/namespaces/{namespace}/oidcproviders` | [List the OIDCProviders of a namespace](/docs/api/security-and-networking/oidcprovider/list.md) |
| `POST` | `/apis/funcd.io/v1alpha1/namespaces/{namespace}/oidcproviders` | [Create an OIDCProvider](/docs/api/security-and-networking/oidcprovider/create.md) |
| `GET` | `/apis/funcd.io/v1alpha1/namespaces/{namespace}/oidcproviders/{name}` | [Read an OIDCProvider](/docs/api/security-and-networking/oidcprovider/get.md) |
| `PUT` | `/apis/funcd.io/v1alpha1/namespaces/{namespace}/oidcproviders/{name}` | [Replace an OIDCProvider](/docs/api/security-and-networking/oidcprovider/replace.md) |
| `DELETE` | `/apis/funcd.io/v1alpha1/namespaces/{namespace}/oidcproviders/{name}` | [Delete an OIDCProvider](/docs/api/security-and-networking/oidcprovider/delete.md) |
