LFI · API Hub · Onboarding · Configuring Auth

JWT Auth — Server-side (LFI Receiving a Token) 2 min read

This page describes how your Ozone Connect server validates JWT Auth tokens sent by the API Hub. See Application Layer Authentication for an overview of all available methods and when to select JWT Auth.

When the API Hub sends requests to your Ozone Connect endpoints, it includes a JWT Auth token in the Authorization header. Your server MUST validate this token on every request.

01 Validating the token

Verify mTLS, signature, and claims on every request

  • Ensure the machine verifying the signature uses NTP to synchronise its clock.
  • Verify that the request was received over a mutual TLS connection.
  • Extract the JWT Auth token from the Authorization HTTP header.
  • Verify the signature on the JWT using the kid specified in the JWS header.
  • Derive the JWKS URI from the requestor's client certificate subject. The OU and CN values are substituted as follows:

Template

text
Sandbox:    https://keystore.sandbox.directory.openfinance.ae/${OU}/${CN}/application.jwks
Production: https://keystore.directory.openfinance.ae/${OU}/${CN}/application.jwks

Example

For a requestor client certificate subject CN=ABC, OU=XYZ, O=Organisation Name, C=AE:

text
https://keystore.sandbox.directory.openfinance.ae/XYZ/ABC/application.jwks
  • The JWKS MAY be cached for up to 10 minutes.
  • Verify each claim in the JWT against the expected values specified in the Claims Reference below.
02 JWT Auth claims reference

Header and body claims

Header

ClaimExpected ValueMandatoryNotes
algPS256Yes
typJOSEYes
ctyjsonYes
kidThe key ID of the keypair used to sign the message, as published on the JWKS.YesOther means of identifying the key (e.g. x5c, x5u) are not supported.

Body

ClaimExpected ValueMandatoryNotes
issThe organisation O value from the TLS certificate Subject used in the transport layer.YesFor a certificate with Subject CN=ABC, OU=XYZ, O=Acme Bank, C=AE, this would be Acme Bank.
subThe organisation unit OU value from the TLS certificate Subject used in the transport layer.YesFor the same certificate, this would be XYZ.
audIdentifier for the party receiving the JWT.YesThis MUST be set to the PROVIDER_ID specified during configuration.
expTime when the JWT will expire, in UTC seconds since epoch.YesRecommended expiry: 10–30 seconds. When validating, allow for a 10-second clock skew. The JWT is invalid if the current time is greater than this value.
iatTime when the JWT was issued, in UTC seconds since epoch.YesWhen validating, allow for a 10-second clock skew. The JWT is invalid if the current time is less than this value.
nbfTime before which the JWT is invalid, in UTC seconds since epoch.NoWhen validating, allow for a 10-second clock skew. The JWT is invalid if the current time is less than this value (when specified).
jtiA unique identifier for the JWT.YesRecommended: populate with a UUIDv4 to increase entropy.