# Pushed authorisation request (PAR)

The pushed authorisation request (PAR) endpoint allows clients to push authorisation request parameters directly to ID Check before redirecting the user. ID Check requires PAR for all authorisation flows.

> **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

```
POST /par
```

## Request format

### Headers

```http
Content-Type: application/x-www-form-urlencoded
```

### Parameters

| Parameter               | Required | Type   | Description                                                      |
| ----------------------- | -------- | ------ | ---------------------------------------------------------------- |
| `client_id`             | Yes      | string | The OAuth client identifier                                      |
| `client_assertion_type` | Yes      | string | Must be `urn:ietf:params:oauth:client-assertion-type:jwt-bearer` |
| `client_assertion`      | Yes      | string | Signed JSON Web Token (JWT) for client authentication            |
| `request`               | Yes      | string | Signed JWT containing authorisation parameters                   |

### Example request

```http
POST /par HTTP/1.1
Host: {base-url}
Content-Type: application/x-www-form-urlencoded

client_id=dip_aci_your_client_id
&client_assertion_type=urn%3Aietf%3Aparams%3Aoauth%3Aclient-assertion-type%3Ajwt-bearer
&client_assertion=eyJhbGciOiJFUzI1NiIsImtpZCI6Im15LWtleSIsInR5cCI6IkpXVCJ9...
&request=eyJhbGciOiJFUzI1NiIsImtpZCI6Im15LWtleSIsInR5cCI6IkpXVCJ9...
```

## Client assertion JWT

See [Authentication](https://docs.stoe.no/id-check/oidc4ia/getting-started/authentication.md) for full details.

**Header (3 claims exactly):**

```json
{
  "alg": "ES256",
  "kid": "my-signing-key",
  "typ": "JWT"
}
```

**Payload (4 required claims, 3 optional):**

```json
{
  "iss": "dip_aci_your_client_id",
  "sub": "dip_aci_your_client_id",
  "aud": "https://{base-url}",
  "exp": 1759835872
}
```

## Request object JWT

The request object contains all authorisation parameters.

### Header

```json
{
  "alg": "ES256",
  "kid": "my-signing-key",
  "typ": "JWT"
}
```

### Payload parameters

| Parameter               | Required | Type   | Description                                                    |
| ----------------------- | -------- | ------ | -------------------------------------------------------------- |
| `iss`                   | Yes      | string | Must be the `client_id`                                        |
| `sub`                   | No       | string | The `client_id`, if present                                    |
| `aud`                   | Yes      | string | ID Check base URL                                              |
| `exp`                   | Yes      | number | Expiration time (Unix timestamp)                               |
| `client_id`             | Yes      | string | The OAuth client identifier                                    |
| `response_type`         | Yes      | string | Must be `code`                                                 |
| `redirect_uri`          | Yes      | string | Registered callback URL                                        |
| `scope`                 | Yes      | string | Must be `openid`                                               |
| `state`                 | Yes      | string | Cross-site request forgery (CSRF) protection value             |
| `nonce`                 | Yes      | string | Replay protection value                                        |
| `code_challenge`        | Yes      | string | Proof Key for Code Exchange (PKCE) code challenge (S256)       |
| `code_challenge_method` | Yes      | string | Must be `S256`                                                 |
| `claims`                | Yes      | object | OpenID Connect for Identity Assurance (OIDC4IA) claims request |

### Claims parameter structure

The `claims` parameter defines which verified claims to request. The client only needs to include the document details fields and identity claims that it wants to receive. Omit any fields that the client does not need.

```json
{
  "id_token": {
    "verified_claims": {
      "verification": {
         "trust_framework": { "value": "stoe" },
          "evidence": [
            {
              "type": {
                "value": "document"
              },
              "document_details": {
                "type": null,
                "document_number": null,
                "date_of_issuance": null,
                "date_of_expiry": null,
                "issuer": null,
                "personal_number": null
              }
            }
          ]
        },
        "claims": {
          "name": { "essential": true },
          "given_name": { "essential": true },
          "family_name": { "essential": true },
          "picture": { "essential": true },
          "gender": { "essential": true },
          "birthdate": { "essential": true },
          "nationalities": { "essential": true }
        }
    }
  }
}
```

> **Note:** Only include the `document_details` fields and `claims` that the client needs. For example, if the client only needs `given_name` and `birthdate`, only include those in the `claims` object. Similarly, if the client only needs the document type and expiry date, only include `type` and `date_of_expiry` in `document_details`.

> **Note:** If requested evidence or claims are not available in the ID Check data, the response does not include them. The response only contains data that was successfully retrieved.

### Trust framework values

| Value       | Description                                                                                                                                                                                                                                                                            |
| ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `stoe`      | Standard trust framework                                                                                                                                                                                                                                                               |
| `stoe_etsi` | European Telecommunications Standards Institute (ETSI) compliant, with stricter validation. Requires the client to request `given_name` and `family_name`. If there is an issuer check, it must be valid. The relying party (RP) must check this: ID Check does not reject the result. |

### Evidence types

| Type       | Description                                    |
| ---------- | ---------------------------------------------- |
| `document` | Physical identity document (passport, ID card) |

### Document details fields

All fields use `null` to indicate that ID Check should populate them:

| Field              | Type   | Description                                                                                                                                                                           |
| ------------------ | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `type`             | string | Document type (`passport`, `idcard`)                                                                                                                                                  |
| `document_number`  | string | Document identification number                                                                                                                                                        |
| `date_of_issuance` | string | Issue date (ISO 8601: `YYYY-MM-DD`)                                                                                                                                                   |
| `date_of_expiry`   | string | Expiry date (ISO 8601: `YYYY-MM-DD`)                                                                                                                                                  |
| `issuer`           | null   | Issuing authority details. Response contains `country_code` (ISO 3166-1 alpha-3) and `name`.                                                                                          |
| `personal_number`  | string | For Norwegian documents, this is the fødselsnummer (NNIN). For non-Norwegian documents, this may contain a national identification number from the issuing country, or may be absent. |

Note: The response only includes a requested field if the data is available from the document. For example, if the client requests `date_of_issuance` but this data is not available from the document, the response does not include it.

### Verified claims fields

| Field           | Type      | Description                                                                    |
| --------------- | --------- | ------------------------------------------------------------------------------ |
| `name`          | string    | Full name                                                                      |
| `given_name`    | string    | First name(s)                                                                  |
| `family_name`   | string    | Last name(s)                                                                   |
| `picture`       | string    | Portrait photo from identity document (data URI: `data:image/jpeg;base64,...`) |
| `gender`        | string    | Gender (`male`, `female`, `unknown`, `unspecified`)                            |
| `birthdate`     | string    | Date of birth (ISO 8601: `YYYY-MM-DD`)                                         |
| `nationalities` | string\[] | List of nationalities (ISO 3166-1 alpha-3)                                     |

## Complete request object example

```json
{
  "iss": "dip_aci_your_client_id",
  "sub": "dip_aci_your_client_id",
  "aud": "https://{base-url}",
  "exp": 1759835872,
  "client_id": "dip_aci_your_client_id",
  "response_type": "code",
  "redirect_uri": "https://client.example.org/callback",
  "scope": "openid",
  "state": "af0ifjsldkj",
  "nonce": "n-0S6_WzA2Mj",
  "code_challenge": "E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM",
  "code_challenge_method": "S256",
  "claims": {
    "id_token": {
      "verified_claims": {
        "verification": {
          "trust_framework": { "value": "stoe" },
          "evidence": [
            {
              "type": {
                "value": "document"
              },
              "document_details": {
                "type": null,
                "document_number": null,
                "date_of_issuance": null,
                "date_of_expiry": null,
                "issuer": null,
                "personal_number": null
              }
            }
          ]
        },
        "claims": {
          "given_name": { "essential": true },
          "family_name": { "essential": true },
          "picture": { "essential": true },
          "gender": { "essential": true },
          "birthdate": { "essential": true },
          "nationalities": { "essential": true }
        }
      }
    }
  }
}
```

## Response

### Success response (201 Created)

```json
{
  "request_uri": "urn:ietf:params:oauth:request_uri:550e8400-e29b-41d4-a716-446655440000",
  "expires_in": 60
}
```

| Field         | Type   | Description                             |
| ------------- | ------ | --------------------------------------- |
| `request_uri` | string | URI to use in the authorisation request |
| `expires_in`  | number | Lifetime in seconds (typically 60)      |

### Error response

```json
{
  "error": "invalid_request",
  "error_description": "Missing required parameter: client_id"
}
```

### Error codes

| Error             | HTTP status | Description                                                                                                   |
| ----------------- | ----------- | ------------------------------------------------------------------------------------------------------------- |
| `invalid_request` | 400         | Missing or invalid parameters, invalid request object claims, scope errors, or signature verification failure |
| `invalid_client`  | 401         | Client authentication failed: unknown client, key not found, or invalid JSON Web Key (JWK)                    |
| `not_found`       | 404         | Encryption key not found for client                                                                           |
| `server_error`    | 500         | Internal server error                                                                                         |

## Using the request URI

After receiving the `request_uri`, redirect the user to the `authorization_endpoint` from the [OpenID configuration](https://docs.stoe.no/id-check/oidc4ia/api/openid-configuration.md). In production, it is `https://start.idverify.bankid.no/auth`:

```
GET https://start.idverify.bankid.no/auth
  ?client_id=dip_aci_your_client_id
  &request_uri=urn:ietf:params:oauth:request_uri:550e8400-e29b-41d4-a716-446655440000
```

## Next steps

- [Token request](https://docs.stoe.no/id-check/oidc4ia/api/token.md) - Exchange authorisation code for tokens
- [Authentication](https://docs.stoe.no/id-check/oidc4ia/getting-started/authentication.md) - JWT requirements
- [ID token](https://docs.stoe.no/id-check/oidc4ia/id-token.md) - ID token structure
