# Connect another OIDC provider

> Setting up any OpenID Connect provider whose ID token carries the national personal code as a Custom OIDC login provider of Oktul eID SSO.
>
> Documentation for Oktul eID SSO for Jira, for Jira Cloud, by Oktul: https://oktul.com/docs/plugins/eid-sso/custom-oidc/

**Custom OIDC** connects an OpenID Connect provider the app has no preset for. You name the
issuer, the client and the claims; the app applies the same checks as for every provider.

## What the provider must support

- The authorization code flow with PKCE (`S256`)
- A confidential client that authenticates with a client secret sent as HTTP Basic
- ID tokens signed with an asymmetric algorithm
- A discovery document at the issuer's address
- An ID token that carries the person's **national personal code** and their country:
  Estonia, Latvia or Lithuania

## At the provider

1. Register a confidential client with the redirect URL shown in the new row.
2. Set the client to authenticate with a client secret sent as HTTP Basic.
3. Note the issuer, the client ID and the secret.

## In the app

1. **On the Login providers tab, select Add a provider and choose Custom OIDC**
2. **Enter the Issuer, the Client ID and the Client secret** The issuer exactly as in the provider's discovery document, including any trailing slash.
3. **Choose how the ID token carries the personal code**
4. **Select Save and connect, and approve Atlassian's dialog** It names the issuer's host and any extra hosts you entered.

## Basic settings

| Setting | What it does |
|---|---|
| **Issuer** | The provider's issuer URL. The app reads the discovery document from it and refuses endpoints on any host you did not approve |
| **Client ID**, **Client secret** | The client you registered. Enter a new secret when the issuer or the client ID changes |
| **Name (optional)** | Shown on the admin page and, with several providers in use, on the [chooser](../providers/#several-providers). Empty shows the issuer's host |
| **Personal code in the ID token** | One of the four forms below |

| Form | Example | Also set |
|---|---|---|
| Country and code together, as in eeID | `EE60001019906` | |
| The Smart-ID form | `PNOEE-60001019906` | |
| The code only, with the country in another claim | `60001019906` | **Country claim**: the claim that holds `EE`, `LV` or `LT`. Lowercase is accepted |
| The code only, with every user from one country | `60001019906` | **Country** |

## Advanced settings

**Show advanced settings** opens the rest. It opens by itself when a stored provider has values
other than the defaults.

| Setting | Default | What it does |
|---|---|---|
| **Personal code claim** | `sub` | The ID token claim that holds the personal code |
| **Extra hosts** | None | HTTPS origins of the provider's endpoints on hosts other than the issuer's. They become part of the egress approval |
| **Scopes** | `openid` | Separated by spaces. `openid` is required. Ask only for what gives the personal code |
| **ID token algorithms** | `RS256` | Asymmetric algorithms only |
| **Allowed methods (amr)** | Empty | The `amr` values whose code claim is a personal code. A login with any other method is refused |
| **Assurance levels (acr, lowest first)** | Empty | The provider's `acr` values, lowest first |
| **Lowest accepted acr** | | One of the levels above. A login below it is refused |
| **Require a fresh login (max_age=0)** | Off | Asks the provider to authenticate the person again on every login, and refuses an ID token without `auth_time` |

<Aside type="caution" title="An empty list turns its check off">
With **Allowed methods (amr)** empty, the app does not check the method, and the form says
*Login methods are not checked*. Some methods give a document number in the same claim as a
personal code. If the provider names its methods, list the ones that give a personal code. Leave
the list empty only if the provider sends none. The same holds for the assurance levels.
</Aside>

<Aside type="note" title="Turn on Require a fresh login if the provider supports it">
Every request already asks the provider to authenticate the person again. With this setting on,
the app also requires proof of when they did. Turn it on only for a provider that supports
`max_age`, and test a login afterwards: a provider that sends no `auth_time` then fails every
login.
</Aside>

## Limits

- **Estonian, Latvian and Lithuanian personal codes only.** A code of another country is refused.
- **No client authentication with a key pair.** That is available with
  [Signicat](../signicat/) only.
- **A provider with an allowlist of client IP addresses** cannot be connected this way. An app
  on Atlassian Forge has no fixed IP address.

## Related

- [Login providers](../providers/)
- [Security](../security/#how-a-login-is-checked)
- [Troubleshooting](../troubleshooting/)

---

A problem or a question? Write to [support@oktul.com](mailto:support@oktul.com) or open a request in the [Help Center](https://support.oktul.com).
