{
  "openapi": "3.1.0",
  "info": {
    "title": "Signing Server support-service DSS API",
    "version": "1.0.0",
    "description": "Browser-mediated document signing through signed DSS requests and SAML identification with separate consent. XML, PDF, detached CMS and the selected PAdES, XAdES and local JAdES bindings are supported. The consumer retains originals and completes B-B, B-T, B-LT or B-LTA using configured RFC3161/RFC5816 timestamps, complete CRLs and independently configured trust. PAdES/XAdES/JAdES require the actual static leaf before preparation. Optional dynamic person signing applies to its documented generic XML/PDF/CMS bindings. Exact signer, credential, consent and ordered input authority is one-use and durable; unknown outcomes grant no automatic retry. See the operation description and XML contract map for the exact limits and profile selections."
  },
  "externalDocs": {
    "description": "Integration guide and complete public synthetic examples",
    "url": "https://github.com/fortifiedid/signing-server/blob/main/docs/70-integration/SUPPORT-SERVICE.md"
  },
  "servers": [
    {
      "url": "https://127.0.0.1:{port}",
      "description": "Example HTTPS origin. Configure the actual service origin and port.",
      "variables": {
        "port": {
          "default": "8443"
        }
      }
    },
    {
      "url": "http://127.0.0.1:{port}",
      "description": "Example HTTPS origin. Configure the actual service origin and port.",
      "variables": {
        "port": {
          "default": "8765"
        }
      }
    }
  ],
  "tags": [
    {
      "name": "Requester",
      "description": "Support service initiates signed DSS requests through the signer browser."
    },
    {
      "name": "Browser",
      "description": "One-shot human browser consent; not a backend authorization capability."
    }
  ],
  "security": [],
  "paths": {
    "/sign/{connection}": {
      "post": {
        "operationId": "beginDssSigning",
        "tags": [
          "Requester"
        ],
        "summary": "Begin the configured DSS signing ceremony",
        "description": "POST through the signer browser. Requester authority is a registered-key whole-document XML signature inside EidSignRequest, not HTTP Bearer authentication. Only the exact registered return Audience is accepted. Content-Type must be exactly application/x-www-form-urlencoded (no charset parameter); duplicate/unexpected fields, query strings and unsupported methods reject. Preserve original XML bytes when Base64-encoding; URL-form-encode all field values. The entire encoded form is capped at 131072 bytes and decoded XML at 65536 bytes. The internal adapter 202 preparation state is never an HTTP acceptance response from this host. Supported SignTaskData types are XML, PDF and CMS. Generic XML/PDF prohibit ProcessingRules; the selected XML/BES XAdES subprofile requires its exact named rule. CMS requires exactly urn:se:idombud:signing:cms:detached-sha256-rsa:v1 and bounded DER signed attributes; original files remain with the consumer. See support-service.xml-contract.json task_profiles and /products/signing-server/next/integration/support-service-reference/ for preparation and detached verification. Consumer UTF-8 text profile reuses CMS: strict UTF-8, 0..1048576 original bytes (consumer bound only), preserved BOM/newlines/Unicode form, no original upload; see /products/signing-server/next/integration/signature-formats/. CMS id-data does not assert text MIME type. The detached XAdES B-B signing binding uses XML, AdESType BES and exact ProcessingRules urn:se:idombud:signing:xades:detached-b-b-sha256-rsa:v1. Generic XML/PDF retain absent ProcessingRules and omitted/None AdESType. XAdES carries immutable canonical SignedInfo and complete AdESObject, with SigningCertificateV2 SHA-256 of the actual preknown static signing-leaf DER; dynamic fresh certificate hosts reject before issuance. The consumer retains the original, verifies its reference and final canonicalization context, configured certificate trust and SignMessage association, and runs the independent EU DSS helper. See /products/signing-server/next/integration/xades/ and task_profiles.XML.xades. Consumer-only XAdES B-T/B-LT/B-LTA augmentation uses configured RFC3161/RFC5816 timestamps, direct embedded validation material and archival renewal; The consumer chooses the completed level; no new HTTP endpoint, task field or per-requester minimum/maximum Baseline level is introduced. Server signing inputs still reject unsigned properties. B-T covers canonical complete ds:SignatureValue element bytes, not raw RSA bytes. LT embeds complete CRLs and public chains in v1.4.1 AnyValidationData without URI under configured independent roots; LTA protects original/reference octets, canonical SignedInfo/SignatureValue/KeyInfo and all preceding unsigned properties in order. Original signing and previous canonical bytes are preserved; renewal never invokes the original signing key. No implicit dynamic fresh certificate support, hosted archival service, universal conformance or production approval follows. See task_profiles.XML.xades.consumer_augmentation for exact grammar, coverage, bounds and recovery. The separate local DSS root Profile urn:se:idombud:signing:dss:jades:v1 uses namespace urn:se:idombud:signing:jades:dss:v1 and ProcessingRules urn:se:idombud:signing:jades:detached-uri-hash-sha256-rsa:v1 through Other extension points; it is not a Sweden Connect SigType. Default-off trusted requesters[].additional_signing_profiles must explicitly allow this profile. The existing /sign/{connection} route and signed DSS/SAML/consent/replay boundaries remain. M is ASCII(base64url(exact strict UTF-8 protected JSON)+\".\") under ObjectIdByURIHash with empty payload contribution, b64=false, RS256 and a preknown static actual leaf binding. SHA-256(M) is prehashed exactly once; originals never upload or fetch. Success echoes exact input/task/rule plus raw signature and actual public certificate evidence; the consumer assembles detached flattened JWS JSON and independently verifies original sigD hashes, trust and SignMessage association using EU DSS. Dynamic fresh certificate hosts reject before identification/issuance. See /products/signing-server/next/integration/jades/, /assets/products/signing-server/api/jades-dss.xsd and local_additional_profiles in the XML map. Consumer-owned JAdES B-T/B-LT/B-LTA augments the unchanged static-leaf B-B signing binding. No Baseline-level field or new endpoint is added. Signature timestamps hash SHA-256 of ASCII of the exact canonical unpadded base64url signature member, not raw RSA bytes. Archives hash retained original octets, ASCII period+protected+period+signature+period, then each preceding exact encoded etsiU string with no separators/quotes/new archive. Encoded append-only unsigned evidence, complete direct-issuer CRLs and separately configured roots support offline full-level verification and up to eight archives. Preserve protected/signature/history encodings. Renewal never invokes the original signing key; failure/unknown outcomes retain the prior artifact and consumed timestamp IDs. See /products/signing-server/next/integration/jades/ and local_additional_profiles.JAdES.consumer_augmentation. No hosted archival service, dynamic fresh leaf extension, production or external conformance claim. Explicit selected PAdES uses SigType PDF, AdESType BES and ProcessingRules urn:se:idombud:signing:pades:baseline-b-sha256-rsa:v1. Its canonical DER SET contains exactly contentType id-data, SHA256 messageDigest and one SigningCertificateV2/ESSCertIDv2 binding to the actual preknown static leaf. CMS signingTime and other attributes are prohibited. The certificate is checked before private signing and against delivery. The consumer owns full-file PDF ByteRange, M and ETSI.CAdES.detached assembly and independent complete-profile validation; no original is uploaded. Generic PDF retains its existing non-AdES semantics. See task_profiles.PDF.pades and /products/signing-server/next/integration/pades/; the consumer completes and verifies all four Baseline levels. The PAdES selection is available only in the October 2026 profile/extension binding. No per-requester minimum/maximum Baseline level is selected by this request; the consumer workflow owns requested-level completion. A historical synthetic task-only preparation fragment is provided at /assets/products/signing-server/support-service/examples/pades-b-b-task.fragment.xml; it is not a complete signed request or form example.",
        "parameters": [
          {
            "name": "connection",
            "in": "path",
            "required": true,
            "description": "Administrator-registered, requester-allowlisted Access connection name; never an arbitrary URL.",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$",
              "example": "access-test"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/DssRequestForm"
              },
              "examples": {
                "completeSynthetic": {
                  "summary": "Complete consumed synthetic XML/PDF snapshot; not replayable",
                  "externalValue": "./examples/support-service/xml-pdf-success-request-form.json"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Browser XHTML page/form. HTTP 200 is not a signing success indication; validate signed DSS ResultMajor on return. The initial page displays the message and requests approval before IdP handoff in both modes; approval alone cannot authorize a signature. Trusted semantic rejection may instead return a signed DSS error form.",
            "headers": {
              "Cache-Control": {
                "description": "Present on handled application responses.",
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/xhtml+xml": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Sanitized local HTTP rejection; no trusted redirect or signing success can be inferred.",
            "headers": {
              "Cache-Control": {
                "description": "Present on handled application responses.",
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string",
                  "const": "Request rejected"
                }
              }
            }
          },
          "404": {
            "description": "No registered host route (framework response; body is not a DSS result)."
          },
          "500": {
            "description": "Sanitized local HTTP rejection; no trusted redirect or signing success can be inferred.",
            "headers": {
              "Cache-Control": {
                "description": "Present on handled application responses.",
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string",
                  "const": "Request rejected"
                }
              }
            }
          },
          "503": {
            "description": "Adapter pending capacity exhausted; no signing performed.",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string",
                  "const": "Request rejected"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "description": "Present on handled application responses.",
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            }
          }
        },
        "x-requester-authentication": "Whole signed XML envelope verified with administrator-registered requester RSA public key.",
        "x-encoded-body-max-bytes": 131072,
        "x-decoded-xml-max-bytes": 65536
      }
    },
    "/consent/{connection}": {
      "post": {
        "operationId": "decideBrowserSigningConsent",
        "tags": [
          "Browser"
        ],
        "summary": "Submit the displayed one-shot browser approval or cancellation",
        "description": "Browser-only continuation of the returned form. Requires the opaque signing_<connection> cookie and matching hidden csrf, exact path and no query string. Cookie is HttpOnly, Path=/, Max-Age=180; HTTPS ACS selects Secure; SameSite=None, loopback HTTP selects SameSite=Lax. Do not synthesize this action from a support-service backend. Approval returns a signed SAML POST form to configured Access. Cancellation returns a signed DSS user-cancel form to the registered return URI. Missing/expired/reused state or CSRF may return HTTP 400 without a DSS callback. In signing_service mode the person approves the displayed original message before handoff to the IdP. Approval starts fresh SAML authentication without SignMessage; only the verified identity combined with this prior one-shot bound approval permits authorization/signing at ACS return. No second post-authentication consent page or caller mode/stage field exists. Optional administrator authentication_redirect_origins permits only configured exact HTTPS origins during the authentication navigation; it is empty by default and cannot be supplied in an HTTP/DSS request.",
        "parameters": [
          {
            "name": "connection",
            "in": "path",
            "required": true,
            "description": "Administrator-registered, requester-allowlisted Access connection name; never an arbitrary URL.",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$",
              "example": "access-test"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/ConsentForm"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Browser XHTML page/form. HTTP 200 is not a signing success indication; validate signed DSS ResultMajor on return. The initial page displays the message and requests approval before IdP handoff in both modes; approval alone cannot authorize a signature. Trusted semantic rejection may instead return a signed DSS error form.",
            "headers": {
              "Cache-Control": {
                "description": "Present on handled application responses.",
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/xhtml+xml": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Sanitized local HTTP rejection; no trusted redirect or signing success can be inferred.",
            "headers": {
              "Cache-Control": {
                "description": "Present on handled application responses.",
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string",
                  "const": "Request rejected"
                }
              }
            }
          },
          "500": {
            "description": "Sanitized local HTTP rejection; no trusted redirect or signing success can be inferred.",
            "headers": {
              "Cache-Control": {
                "description": "Present on handled application responses.",
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string",
                  "const": "Request rejected"
                }
              }
            }
          }
        },
        "x-browser-only": true
      }
    }
  },
  "webhooks": {
    "dssResponse": {
      "post": {
        "operationId": "receiveDssSigningResponse",
        "tags": [
          "Requester"
        ],
        "summary": "Consumer-owned registered return URI receives the browser DSS POST",
        "description": "This operation belongs to the support service, not Signing Service. The URL is its pre-registered return_uri, exactly matched by the signed request Audience; /reply is only a fixture example. The browser submits Binding, RelayState and EidSignResponse. Validate envelope key, schema/profile/version, RequestID/RelayState/private session binding, signed ResultMajor/ResultMinor, signer/assurance, exact ordered task bytes and certificate/signature evidence before reconstructing and verifying complete original documents. Duplicate, unknown, expired or mismatched session replies must be rejected. HTTP response policy belongs to the consumer; no server notification, retry schedule or guaranteed delivery is implemented. For selected XML/BES XAdES also match exact ProcessingRules, immutable AdESObject/SignatureId and canonical SignedInfo, actual configured signing-leaf certificate binding, detached original and assembled-context/profile validation; raw signature verification alone is insufficient. For XAdES B-T/LT/LTA, perform consumer-only unsigned augmentation and independently verify the exact requested complete level with retained originals, explicit roots and embedded evidence; preserve signed canonical bytes and prior unsigned context. Timestamp/archive failures leave the prior artifact unchanged and never authorize re-signing. See docs/70-integration/XADES.md. For explicitly selected local JAdES root profile, match SignatureObject/Other/jad:JadesSignTasks, exact ordered TaskId, ProcessingRules and ToBeSignedBytes; verify Base64Signature Type rsa-sha256 and actual public signing certificate evidence before detached JWS assembly. Validate the full selected profile against retained originals; response trust alone is insufficient. For selected PAdES, also match PDF/BES, the exact ProcessingRules URI, unchanged DER signed attributes and actual expected leaf binding; preserve the retained PDF ByteRange/M/Contents construction, assemble detached CMS and independently validate the requested complete PAdES level. A server signature result alone does not establish B-T/LT/LTA; see docs/70-integration/PADES.md. Consumer-owned JAdES B-T/B-LT/B-LTA augments the unchanged static-leaf B-B signing binding. No Baseline-level field or new endpoint is added. Signature timestamps hash SHA-256 of ASCII of the exact canonical unpadded base64url signature member, not raw RSA bytes. Archives hash retained original octets, ASCII period+protected+period+signature+period, then each preceding exact encoded etsiU string with no separators/quotes/new archive. Encoded append-only unsigned evidence, complete direct-issuer CRLs and separately configured roots support offline full-level verification and up to eight archives. Preserve protected/signature/history encodings. Renewal never invokes the original signing key; failure/unknown outcomes retain the prior artifact and consumed timestamp IDs. See docs/70-integration/JADES.md and local_additional_profiles.JAdES.consumer_augmentation. No hosted archival service, dynamic fresh leaf extension, production or external conformance claim.",
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/DssResponseForm"
              },
              "examples": {
                "completeSynthetic": {
                  "summary": "Complete consumed synthetic XML/PDF snapshot; not replayable",
                  "externalValue": "./examples/support-service/xml-pdf-success-response-form.json"
                }
              }
            }
          }
        },
        "responses": {
          "default": {
            "description": "Receiver-defined application response after verification or rejection. Fixture-specific acknowledgements are not a Signing Service contract."
          }
        },
        "x-browser-mediated": true
      }
    }
  },
  "components": {
    "schemas": {
      "DssRequestForm": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "Binding",
          "RelayState",
          "EidSignRequest"
        ],
        "properties": {
          "Binding": {
            "type": "string",
            "const": "POST/XML/1.0"
          },
          "RelayState": {
            "type": "string",
            "minLength": 20,
            "maxLength": 96,
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{19,95}$",
            "description": "Exact RequestID inside signed DSS XML. Preserve it unchanged on reply and correlate against private consumer session state."
          },
          "EidSignRequest": {
            "type": "string",
            "contentEncoding": "base64",
            "contentMediaType": "application/xml",
            "maxLength": 90000,
            "description": "Base64 original signed XML bytes. Validate the pinned XML schema and whole-envelope signature; JSON Schema alone cannot perform those checks. No private keys or original documents."
          }
        }
      },
      "DssResponseForm": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "Binding",
          "RelayState",
          "EidSignResponse"
        ],
        "properties": {
          "Binding": {
            "type": "string",
            "const": "POST/XML/1.0"
          },
          "RelayState": {
            "type": "string",
            "minLength": 20,
            "maxLength": 96,
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{19,95}$",
            "description": "Exact RequestID inside signed DSS XML. Preserve it unchanged on reply and correlate against private consumer session state."
          },
          "EidSignResponse": {
            "type": "string",
            "contentEncoding": "base64",
            "contentMediaType": "application/xml",
            "description": "Base64 original signed XML bytes. Validate the pinned XML schema and whole-envelope signature; JSON Schema alone cannot perform those checks. No private keys or original documents. Receiver body limits belong to the consumer; the service does not advertise an outbound response byte ceiling."
          }
        }
      },
      "ConsentForm": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "csrf",
          "decision"
        ],
        "properties": {
          "csrf": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{43}$",
            "description": "Use the opaque hidden value issued with the browser session. Not signer authority."
          },
          "decision": {
            "type": "string",
            "enum": [
              "approve",
              "cancel"
            ]
          }
        }
      }
    }
  },
  "x-implementation": {
    "host": "modules/local-runtime/src/main/java/se/idombud/signing/local/LocalSamlSigningApplication.java",
    "adapter": "modules/protocol-dss/src/main/java/se/idombud/signing/dss/DssAdapter.java",
    "xmlContract": "support-service.xml-contract.json",
    "accessAssertionConsumerPath": "Configured connections[].acs path; SAMLResponse/RelayState browser callback, not a support-service DSS result endpoint.",
    "jadesSchema": "jades-dss.xsd"
  },
  "x-event-log-configuration": {
    "schema": "event-log.configuration.schema.json",
    "contract": "event-log.contract.json",
    "scope": "Optional trusted local event_log section for this explicit service mode; not an HTTP request field. Absent means disabled; database audit and signing authorization remain separate."
  }
}
