# OpenID Configuration

The OpenID Configuration endpoint provides discovery metadata for the ID Check OpenID Provider, following the [OpenID Connect Discovery 1.0](https://openid.net/specs/openid-connect-discovery-1_0.html) specification.

> **Preview**
>
> ID Check OIDC4IA is in preview, so it can change. For a stable integration, use [ID Check](https://docs.stoe.no/id-check.md).

## Endpoint

```
GET /.well-known/openid-configuration
```

## Response

The endpoint returns a JSON object containing the OpenID Provider metadata.

### Response headers

| Header          | Value                   |
| --------------- | ----------------------- |
| `Content-Type`  | `application/json`      |
| `Cache-Control` | `public, max-age=86400` |

### Response body

```json
{
  "issuer": "https://api.idverify.bankid.no",
  "authorization_endpoint": "https://start.idverify.bankid.no/auth",
  "token_endpoint": "https://api.idverify.bankid.no/token",
  "jwks_uri": "https://api.idverify.bankid.no/jwks",
  "pushed_authorization_request_endpoint": "https://api.idverify.bankid.no/par",
  "scopes_supported": ["openid"],
  "response_types_supported": ["code"],
  "subject_types_supported": ["pairwise"],
  "id_token_signing_alg_values_supported": ["ES256"],
  "id_token_encryption_alg_values_supported": ["RSA-OAEP-256"],
  "id_token_encryption_enc_values_supported": ["A256GCM"],
  "claims_supported": [
    "sub",
    "iss",
    "aud",
    "iat",
    "exp",
    "auth_time",
    "nonce",
    "acr",
    "amr",
    "azp",
    "verified_claims",
    "jti"
  ],
  "acr_values_supported": ["urn:bankid:idcheck"],
  "token_endpoint_auth_methods_supported": ["private_key_jwt"],
  "require_pushed_authorization_requests": true,
  "require_signed_request_object": true,
  "request_parameter_supported": true,
  "request_uri_parameter_supported": false,
  "claims_parameter_supported": true,
  "claim_types_supported": ["normal"],
  "verified_claims_supported": true,
  "trust_frameworks_supported": ["stoe", "stoe_etsi"],
  "evidence_supported": ["document"],
  "claims_in_verified_claims_supported": [
    "name",
    "given_name",
    "family_name",
    "picture",
    "gender",
    "birthdate",
    "nationalities"
  ],
  "documents_supported": ["idcard", "passport"],
  "documents_check_methods_supported": ["vcrypt", "data"],
  "authorization_response_iss_parameter_supported": true,
  "code_challenge_methods_supported": ["S256"],
  "grant_types_supported": ["authorization_code"]
}
```

## Configuration fields

### Core endpoints

| Field                                   | Description                                                                                                                 |
| --------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- |
| `issuer`                                | The OpenID Provider's issuer identifier. Clients use this value to validate the ID token.                                   |
| `authorization_endpoint`                | URL for starting user authentication. Clients do not use it directly: they use the pushed authorisation request (PAR) flow. |
| `token_endpoint`                        | URL for exchanging authorisation codes for tokens.                                                                          |
| `jwks_uri`                              | URL for retrieving the provider's public keys for signature verification.                                                   |
| `pushed_authorization_request_endpoint` | URL for the PAR endpoint (RFC 9126).                                                                                        |

### Supported features

| Field                      | Description                                                                   |
| -------------------------- | ----------------------------------------------------------------------------- |
| `scopes_supported`         | Supported OAuth 2.0 scopes. ID Check supports `openid`.                       |
| `response_types_supported` | Supported response types. ID Check uses the authorisation code flow (`code`). |
| `subject_types_supported`  | Subject identifier types. ID Check uses `pairwise` subjects.                  |
| `acr_values_supported`     | Supported Authentication Context Class References.                            |

### Token configuration

| Field                                      | Description                                              |
| ------------------------------------------ | -------------------------------------------------------- |
| `id_token_signing_alg_values_supported`    | Algorithms for signing ID tokens. ID Check uses `ES256`. |
| `id_token_encryption_alg_values_supported` | Key encryption algorithms. ID Check uses `RSA-OAEP-256`. |
| `id_token_encryption_enc_values_supported` | Content encryption algorithms. ID Check uses `A256GCM`.  |

### Claims

| Field                        | Description                                                                                                          |
| ---------------------------- | -------------------------------------------------------------------------------------------------------------------- |
| `claims_supported`           | Claims that ID Check can return in ID tokens. The list includes `azp`, but ID Check does not put `azp` in ID tokens. |
| `claim_types_supported`      | Types of claim delivery supported. ID Check uses `normal` (claims returned directly in the token).                   |
| `claims_parameter_supported` | Whether ID Check supports the `claims` parameter in requests.                                                        |

### Authentication

| Field                                   | Description                                                                   |
| --------------------------------------- | ----------------------------------------------------------------------------- |
| `token_endpoint_auth_methods_supported` | Supported client authentication methods. ID Check requires `private_key_jwt`. |

### Request handling

| Field                                   | Description                                                                                                                                                                                                                                                         |
| --------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `require_pushed_authorization_requests` | Whether PAR is required. ID Check requires PAR (`true`).                                                                                                                                                                                                            |
| `require_signed_request_object`         | Whether clients must sign request objects. ID Check requires signed request objects (`true`).                                                                                                                                                                       |
| `request_parameter_supported`           | Whether ID Check supports JSON Web Token (JWT) request objects.                                                                                                                                                                                                     |
| `request_uri_parameter_supported`       | Whether ID Check accepts a `request_uri` that points to a request object that the client hosts. ID Check sets it to `false`. This value does not apply to the `request_uri` that the PAR endpoint returns: the client sends that one to the authorisation endpoint. |

### FAPI 2.0

| Field                                            | Description                                                                                                                                                 |
| ------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `authorization_response_iss_parameter_supported` | Whether the authorisation response includes the `iss` parameter ([RFC 9207](https://www.rfc-editor.org/rfc/rfc9207)). ID Check always includes it (`true`). |
| `code_challenge_methods_supported`               | Supported Proof Key for Code Exchange (PKCE) code challenge methods. ID Check requires `S256`.                                                              |
| `grant_types_supported`                          | Supported OAuth 2.0 grant types. ID Check supports `authorization_code`.                                                                                    |

### Identity assurance (OIDC4IA)

| Field                                 | Description                                                                                        |
| ------------------------------------- | -------------------------------------------------------------------------------------------------- |
| `verified_claims_supported`           | Whether ID Check supports OpenID Connect for Identity Assurance (OIDC4IA) verified claims.         |
| `trust_frameworks_supported`          | Supported trust frameworks for identity verification.                                              |
| `evidence_supported`                  | Supported evidence types (`document`).                                                             |
| `claims_in_verified_claims_supported` | Claims available within `verified_claims` (e.g. `name`, `given_name`, `family_name`, `birthdate`). |
| `documents_supported`                 | Supported identity document types (`idcard`, `passport`).                                          |
| `documents_check_methods_supported`   | Supported document verification methods (`vcrypt`, `data`).                                        |

## Notes

- PAR is **required**. ID Check does not support direct calls to the authorisation endpoint
- ID Check always **encrypts** ID tokens, as a JSON Web Encryption (JWE) that contains a signed JWT
- Client authentication must use `private_key_jwt` with supported algorithms (ES256, PS256, EdDSA)
- ID Check supports [OpenID Connect for Identity Assurance (OIDC4IA)](https://openid.net/specs/openid-connect-4-identity-assurance-1_0.html) for verified identity claims
