The Xentara Web Service v1.3
User Manual
Loading...
Searching...
No Matches
Model File Format
See also
The Xentara Model File in the Xentara user manual

JSON Format for Servers

A JSON object describing a Web Service Server has the following syntax:

{
"@Microservice.WebService.Server": {
"id": "Web Service",
"uuid": "1172f36f-9962-4580-8590-177d2761f2d5",
"portNumber": 8080,
"authentication": {
...
},
"serverCertificate": "/home/xentara/.config/xentara/web-service/server-certificate.pem",
"endpoints": {
"/api/v1/turbine/start": "Turbine.Start",
"/api/v1/turbine/stop": "Turbine.Stop",
"/api/v1/turbine/temperatures/intake": "Turbine.Temperatures.Intake",
"/api/v1/turbine/temperatures/exhaust": "Turbine.Temperatures.Exhaust"
}
}
}

Object Members
idA string value containing the ID of the server. The ID is used to construct the server’s primary key.
uuidA string value containing the unique UUID of the server.
portNumberA numeric value containing the TCP port number the server should listen on.
authenticationA JSON object describing the authentication scheme used by the server. The format of this object is described below.
serverCertificateAn string value containing the absolute path to the server certificate. The certificate file must be a PEM format file, and must include both the actual certificate, and the accociuated private key. See here for an example of the structure of a valid server certificate file.
endpoints

A JSON object containing the list of endpoints. Each member of the object defines a single endpoint.

The name of the member (before the colon) defines the path of the endpoint. The path must be a valid URL path element, and must start with a slash (“/”). The path must not end in a slash (“/”).

The value of the member (after the colon) defines the data point associated with the endpoint. It must be a string value containing the primary key of a Xentara data point or Xentara I/O point.

Authentication Object

See also
RFC 7519 — JSON Web Token (JWT)
RFC 6749 — The OAuth 2.0 Authorization Framework
OpenID Connect Core 1.0

The authentication is represented by a double nested JSON object. The outer object has a single member whose name is the authentication method, and whose value is another JSON object that contains the actual authentication parameters.

The Xentara Web Service always uses JSON Web Tokens for authentication. The Authentication method string must always be @JWT.

The JSON object describing the authentication scheme has the following syntax:

"authentication": {
"@JWT": {
"realm": "Xentara",
"scope": [ "openid", "com.mycompany:entitlements" ],
"issuer": "https://openid.mycompany.com/",
"audience": "Xentara",
"claims": {
"entitlements": [ "IoT" ]
},
"verification": {
...
}
}
}
}

Inner Object Members
realm

An optional string value containing the realm to be returned in the WWW-Authenticate header in authentication error responses. The realm is a purely informative value intended to be used by the client to select the correct authentication provider. It is in essence an arbitrary value, but should be different for servers that use a different authentication scheme.

The “realm” directive is described in section 1.2. of RFC 2617 — Basic and Digest Access Authentication.

scope

An optional array of string values containing the scope values to be returned in the WWW-Authenticate header in authentication error responses.

The scope attribute is tell the client which scope it needs to request from an OAuth 2.0 authorization provider. The “scope” attribute is described in section 3.3. of RFC 6749 — The OAuth 2.0 Authorization Framework.

If you are using an OpenID Connect authorization provider, don’t forget to include the string “openid” in the scope, as described in 5.4. Requesting Claims using Scope Values in the OpenID Connect Core 1.0 specification. In OpenID Connect, the scope is used to tell the authorization provider which claims it should include in the token.

Attention
Unlike issuer and audience, the scope specified here is not automatically checked against the scope claim in the authentication token, as this would be incompatible with OpenID Connect. If you mant the Xentara Web Service to check the scope claim in the authentication token, you must add it to the claims configuration parameter described below.
issuerA string value specifying the allowed issuer of the token. This is in general the URL of the authentication provider. The issuer specified here is checked against the iss claim of the authentication token.
audienceA string value specifying the required audience of the token. The audience specifies the purpose for which a token was issued. The audience specified here is checked against the aud claim of the authentication token.
claimsAn optional JSON object specifying any additional claims to be checked. Each member specifies a claim name, together with an array of allowed values. The values are checked as described in Additional JWT Claims.
verificationA JSON object specifying the method used to verify the signature of the token. The format of this object is described below.

Verification Object

The verification is represented by a double nested JSON object. The outer object has a single member whose name is the verification method, and whose value is another JSON object that contains the actual verification parameters.

Public Key Verification

Public key verifies the signature using the known public key of the issuer. The JSON object describing public key verification has the following syntax:

"verification": {
"@RS512": {
"keyFile": "/home/xentara/.config/xentara/web-service/mycompany-openid-public-key.pem"
}
}

Method Descriptor

The verification method descriptor in the outer JSON object specifies the algorithm the issuer uses to sign the authentication token. The following algorithms are supported:

  • @RS256
  • @RS384
  • @RS512
  • @HS256
  • @HS384
  • @HS512
  • @ES256
  • @ES256K
  • @ES384
  • @ES512
  • @PS256
  • @PS384
  • @PS512
  • @ED25519
  • @ED448
Inner Object Members
keyFileAn string value containing the absolute path to the file containing the issuer’s public key. The file must be in PEM format.

Verification Using a JSON Web Key Set

Public key verifies the signature using a JSON Web Key Set.

"verification": {
"@JWKS": {
"jwksFile": "/home/xentara/.config/xentara/web-service/mycompany-jwk-set.json"
}
}

Method Descriptor
The verification method descriptor in the outer JSON object must be @JWKS for JSON Web Key Set verification.
Inner Object Members
keyFileAn string value containing the absolute path to a locally stored copy of the issuer’s JWK Set file. JWKS files are in JSON format.