> ## Documentation Index
> Fetch the complete documentation index at: https://developers.gonitro.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Mandated signing

> Find out which stakeholder properties a signing method's mandated signing rules require, and pass them when you create stakeholders.

**Mandated signing** checks that the person signing is the person you intended. When a signing
method has mandated signing rules, NSEV compares stakeholder data you supply, such as a last name,
birth date, or national ID, with the data in the signing certificate or returned by the signing
service. The signer can only sign if the two match.

Mandated signing rules are part of your tenant's configuration, which the Nitro delivery team
sets up. You can't override the rules through the API. Instead, the API tells you which properties
the rules need, and you supply those properties when you create the stakeholder.

> [!NOTE]
>
> To add, remove, or change the mandated signing rules for your tenant, contact your Nitro delivery
> team or [Nitro support](https://connectivegroup.my.site.com/s/contactsupport?language=en_US).

## Step 1: Find the required properties

Call [List signing methods](https://developers.gonitro.com/docs/nsev/api-reference/configuration/list-signing-methods.md) to list the
signing methods available on your tenant. Each method has a `RequiredProperties` array. If it's
not empty, mandated signing rules apply to that method, and every property in the array becomes
mandatory for any stakeholder who signs with it.

```bash theme={null}
curl "$BASE_URL/signingmethods?isActive=true" \
  -H "Authorization: Bearer {access_token}" \
  -H "User-Agent: MyApp/1.0"
```

In this response, `MailOtp:MailOtp` has no rules. `SmartCard:BeID` has two rules, one on the
stakeholder's birth date and one on their last name:

```json theme={null}
[
  {
    "IsActive": true,
    "Name": "MailOtp:MailOtp",
    "DisplayNames": { "en": "Email one-time password" },
    "RequiredProperties": []
  },
  {
    "IsActive": true,
    "Name": "SmartCard:BeID",
    "DisplayNames": { "en": "Belgian eID" },
    "RequiredProperties": ["BirthDate", "LastName"]
  }
]
```

A required property is either a standard stakeholder field, such as `BirthDate` or `LastName`, or an
additional property set up for your tenant, such as `BeId`.
Additional properties go in the stakeholder's `AdditionalProperties` object. See
[The package model → Additional properties](https://developers.gonitro.com/docs/nsev/build/concepts/package-model.md#additional-properties).

> [!TIP]
>
> The rules only change when the delivery team updates your tenant, so you can cache this response
> rather than calling it before every package.

## Step 2: Pass the required properties when you create the stakeholder

Include every required property when you call
[Create stakeholder](https://developers.gonitro.com/docs/nsev/api-reference/stakeholders/create-stakeholder.md), or when you inline the
stakeholder in an [instant package](https://developers.gonitro.com/docs/nsev/build/tutorials/instant-package.md).

The properties are checked when a Signer actor gets a signing field that uses the signing method,
not when the stakeholder is created. So if a required property is missing, it's the create-actor,
create-element, process, or instant-package call that fails, with `409 Conflict`:

```json theme={null}
{
  "ErrorCode": "Stakeholder.MissingProperties",
  "ErrorMessage": "Stakeholder has missing properties [BirthDate] required to use with signing method [SmartCard:BeID]."
}
```

A property counts as missing if it's absent or empty.

For a signer who will use `SmartCard:BeID` in the example above:

```json theme={null}
{
  "Type": "Person",
  "Language": "en",
  "FirstName": "Jane",
  "LastName": "Smith",
  "EmailAddress": "jane.smith@example.com",
  "BirthDate": "1985-04-12"
}
```

If the rules also required an additional property such as `BeId`, you'd add it like this:

```json theme={null}
"AdditionalProperties": {
  "BeId": "85041212345"
}
```

When the signer signs, NSEV compares these values with the data read from their eID card. If they
don't match, the signer can't sign with that method.

### How the values are compared

Each rule is set up by the delivery team, so how strict the comparison is depends on your tenant.
In general:

* **Accents are ignored.** `Müller` matches `Muller`.
* **Names must match exactly by default.** A rule can be set to accept close matches, such as a
  small spelling difference.
* **Dates are compared as dates**, so the format the certificate uses doesn't matter.
* **ID numbers can be compared without formatting.** If the rule is set up that way, dots, dashes,
  underscores and spaces are ignored, so `85.04.12-123.45` matches `85041212345`.
* **Some rules are optional.** They're only checked when both your value and the certificate value
  are present.

To find out how strict the rules on your tenant are, ask your Nitro delivery team.

### Groups and contact groups

* **Group stakeholders:** put the required properties on **each member** in `Members`, not on the
  group itself. The request only fails if **no** member has them. In that case you get one
  `PersonGroup.MemberMissingProperties:{email}` error per member, plus
  `PersonGroup.MissingProperties`. A member who lacks the properties can't sign with that method,
  and [Get package warnings](https://developers.gonitro.com/docs/nsev/api-reference/packages/get-package-warnings.md) reports them.
* **ContactGroup stakeholders:** the members come from a contact group stored in the WebPortal, so
  you can't pass their properties in the request. Fill in the required properties for each contact
  in the WebPortal before you reference the contact group. The same rules apply as for groups, with
  `ContactGroup.MemberMissingProperties:{email}` and `ContactGroup.MissingProperties` errors.

> [!NOTE]
>
> When the package is activated, a signing method that none of an actor's assigned people can use is
> dropped from that actor. If that leaves the actor with no usable signing method, activation fails
> with `409 Actor.NoViableSigningMethods`.

### Reassigning a signer

If you [reassign](https://developers.gonitro.com/docs/nsev/build/concepts/package-model.md#reassigning-an-actor) a Signer whose signing
method has mandated signing rules, the replacement person must supply the same required properties.
Pass them in the reassignment request. If one is missing, the request fails with
`409 MandatedSigner.MissingRequiredProperty`.

## Next steps

* Choose signing methods for each signing field in [Field positioning](https://developers.gonitro.com/docs/nsev/build/guides/field-positioning.md)
* Read about behaviours that often surprise integrators in [Gotchas](https://developers.gonitro.com/docs/nsev/build/guides/gotchas.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.