For the complete documentation index, see llms.txt. This page is also available as Markdown.

Consent & Privacy

The SanteDB software solution implements a policy enforcement scheme similar to the XACML architectural components (see: Privacy Architecture).

When accessing resources from the API, a failed consent/policy decision will be provided to the caller.

Policy Violation - Denied

When a policy violation is denied (the principal does not have any route to elevate), an HTTP 403 Forbidden response is sent with details of the policy violation. For example:

HTTP/1.1 403 Forbidden
Content-Type: application/json

{
    "$type": "PolicyViolationException",
    "message": "Policy '1.3.6.1.4.1.33349.3.1.5.9.2.0.6' was violated by 'Allison' with outcome 'Deny'",
    "policyId": "1.3.6.1.4.1.33349.3.1.5.9.2.0.6",
    "policyOutcome":"Deny",
}

Policy Violation - Elevation

Under certain conditions, some policies which are DENIED can be overridden by the user. The conditions under which this occurs is:

  • The policy which was violated has the can override flag set to true

  • The user has access to the Override Policy (1.3.6.1.4.1.33349.3.1.5.9.2.999) set to GRANT

  • Neither the application, nor the device principal the user is accessing the system with are denied the Override Policy

When an elevation condition is detected, the server will respond with a 401 Unauthorized response.

For example:

When this condition occurs, clients may use the Override headers as discussed in the OpenID Connect page.

Masked Results

Depending on the configuration of the SanteDB server, requesting access to a protected record may implement masking logic rather than returning a 401. This provides an opportunity for clients to discover that a privacy protection has occurred.

For example, when fetching a FHIR patient resource for a protected patient, the response may disclose a masked record, as illustrated below

The same pattern applies using the HDSI interface. Th masking is indicated by the tag $pep.masked and the security labels applied indicate the policies which are applied to the object.

Upon receiving the 401 unauthorized response from a resource or detecting a masked record, the client is expected to prompt for the user's credentials (or collect a new auth code from the OAUTH endpoint) and explicitly override the identified policies.

The client is expected to pass the following client assertions to the iCDR or dCDR instance:

Assertion
Value

urn:oasis:names:tc:xspa:1.0:subject:facility

The UUID of the facility in which the user is accessing the record

urn:santedb:org:claim:override

The fixed value true

urn:oasis:names:tc:xacml:2.0:action:purpose

The purpose of accession of the record / override. This should be the UUID of the appropriate concept, or the mnemonic (example: Purpose-EmergencyTreatment)

urn:santedb:org:claim:temporary

true if the access token is a one-time use (limited to 2 minute), or false if the token is expected to be used more than once.

The client assertions are passed via the X-SanteDB-ClientClaim header or as a JWT assertion in the client_assertion fields in the OAUTH body.

Last updated

Was this helpful?