Relying party documentation

Document signing for relying parties

Your portal keeps PDFs on your servers; the eID API orchestrates prepare → Smart Signer → inject. You never deploy sign-util.jar or vendor API keys on the RP.

Guide v1.2Updated 20 November 2026

1. Purpose

After Sign in with eID, an authenticated citizen can sign a PDF through your application. Your backend calls eID with the citizen's access token. eID validates eligibility, runs the signing toolchain, and returns a base64-encoded signed PDF.

2. Architecture

Citizen browserYour RP (/login)SXM Identity BrokerSint Maarten eID (MFA)Your RP (callback)

Typical flow: citizen SSO at RP → upload PDF in RP UI (leave the upload enabled) → RP server POST https://sxm-eid-dev.eastus.cloudapp.azure.com/api/rp/esign/documents/sign with Authorization: Bearer and X-Sso-Client-Id → store returned PDF. Do not require a validate call before showing the file input.

3. Prerequisites

RequirementWhoNotes
SSO integrationRPSee /developers/sso/quickstart — broker or sandbox OIDC
Scope esign_sign + eidPlatform adminOidcClients.AllowedScopes — /admin/rp-applications → Update OIDC policy
Issued eSign certificateCitizenActive citizen + Issued row in CitizenEsignCertificates
EID_API_BASE_URLRP opsReachable from RP server (e.g. https://sxm-eid-dev.eastus.cloudapp.azure.com)
DocumentSigning enabledeID opssign-util.jar + Smart Signer on API host

4. API contract

MethodPathAuth
GET/api/rp/esign/healthNone — includes maxFileSizeBytes when enabled
POST/api/rp/esign/documents/signRequired. Bearer citizen access token from SSO. This is the call that signs the PDF.
POST/api/rp/esign/documents/validateOptional preflight. Same Bearer. Do not disable upload when you skip it.

Sign request

HTTP
POST https://sxm-eid-dev.eastus.cloudapp.azure.com/api/rp/esign/documents/sign
Authorization: Bearer {citizen_access_token}
X-Sso-Client-Id: {your_wso2_client_id}   # same id as OidcClients.ClientId
Content-Type: multipart/form-data

file=<application/pdf>

Optional validate (preflight)

Same headers as sign. COCI does not call this. The sign route already checks the token, the citizen, and the eSignature certificate. Use validate only if you want those errors before running the signing toolchain.

HTTP
POST https://sxm-eid-dev.eastus.cloudapp.azure.com/api/rp/esign/documents/validate
Authorization: Bearer {citizen_access_token}
X-Sso-Client-Id: {your_wso2_client_id}

file=<application/pdf>             # optional — size + PDF magic bytes

Validate success (JSON)

JSON
{
  "valid": true,
  "eid": "SXM-123456789",
  "rpClientId": "YOUR_WSO2_CLIENT_ID",
  "esignCertificateActive": true,
  "maxFileSizeBytes": 10485760,
  "acceptedMediaTypes": ["application/pdf"]
}

Sign success (JSON)

JSON
{
  "signedDocumentBase64": "...",
  "certificateSerial": "SXMESN...",
  "signedAt": "2026-11-19T12:00:00Z",
  "auditReference": "uuid"
}

5. Authentication paths

PathTokenWhen
Broker SSO (recommended)WSO2 access token from portal loginSet X-Sso-Client-Id to your WSO2 client_id. Approve writes oidc_wso2_relay_mappings so that id maps to itself (the OidcClients row).
Direct eID OIDCeID-issued access token with esign_signSandbox or custom RPs; authorize includes esign_sign scope

6. Validation errors

Failed responses include a stable error code and message. Leave the PDF upload enabled and show that message from the sign response. A missing relay row is 401 invalid_token ("Broker client is not mapped"), not a disabled file input.

errorHTTPMeaning
missing_file400No multipart file field
invalid_pdf400Bytes are not a PDF (%PDF-)
file_too_large400Over DocumentSigning:MaxFileSizeBytes (see health maxFileSizeBytes)
invalid_token401Missing or unusable Bearer token, or X-Sso-Client-Id is not in oidc_wso2_relay_mappings
token_expired401Access token past lifetime
esign_signing_not_allowed403OidcClients or token missing esign_sign / eid (broker rules apply)
citizen_not_found404eid claim does not match a citizen
esign_not_active422No issued CitizenEsignCertificates row
citizen_ineligible422Citizen suspended, revoked, deceased, or not Active/Verified
eid_mismatch422Optional form eid ≠ token citizen
signing_disabled503DocumentSigning:Enabled=false
signing_unavailable503Smart Signer or sign-util.jar not ready
sign_engine_error502Vendor rejected hash sign
sign_util_error502Prepare or inject failed

7. Next steps