Source code and setup instructions: darkedges/udap-agent-trust-poc.
An approved certificate establishes an identity binding, but the service still needs proof that the requesting agent controls the corresponding private key. This part follows that proof through dynamic registration and token authentication.
The earlier installments established the service boundaries and enrollment workflow. Here we use those foundations in two distinct exchanges: a signed registration statement and a fresh client assertion. The examples describe the local provider, with a separate certificate-only path for our fixed trust community.
Registration and authentication use different signed statements
The registered path starts with a signed software statement. This is the central idea borrowed from UDAP Dynamic Client Registration: the client supplies registration metadata in a JWT backed by its certificate, allowing the server to verify the signature and certificate trust before accepting the registration.
An illustrative payload is:
{
"iss": "https://trust.example.test/orgs/partner-a/agents/<agent-id>",
"sub": "https://trust.example.test/orgs/partner-a/agents/<agent-id>",
"aud": "https://localhost:8443/oauth/register",
"iat": 1796000000,
"exp": 1796000090,
"jti": "<fresh-random-identifier>",
"client_name": "Research agent",
"grant_types": ["client_credentials"],
"token_endpoint_auth_method": "private_key_jwt",
"scope": "documents.read recommendations.create"
}
The example timestamps are illustrative. The running service creates fresh values for each statement. The JWT header carries alg: RS256 and an x5c array containing the signing certificate.
The POC verifies the direct issuing CA, certificate validity, registered certificate status, JWT signature, audience, identity claims, lifetime and replay identifier. It checks the statement's identity against the approved agent and confirms that the requested scopes fit both the certificate ceiling and current policy.
Only after validation does it commit the client record. The resulting client ID is bound to the certificate fingerprint and registered scopes. Re-registering the same agent preserves its client ID.
Atomic registration is worth testing explicitly. In the original lab, a statement missing client_name could update the client record and then fail while constructing its response. The corrected flow validates required metadata and prepares the response before changing registration state. A rejected registration must not quietly change an existing client's access.
Token authentication uses a different JWT. Its issuer and subject are the assigned client ID, and its audience is the token endpoint. It proves control of the signing key for that client; it does not repeat the operator's browser login.
grant_type=client_credentials
client_assertion_type=urn:ietf:params:oauth:client-assertion-type:jwt-bearer
client_assertion=<fresh-signed-JWT>
scope=documents.read
udap=1
If the request also supplies client_id, the POC requires it to match the signed identity. Ignoring a contradictory parameter would leave the request describing two clients at once.
Assertions last 90 seconds. Each request needs a fresh replay identifier; presenting a previously consumed assertion fails. Replay state is persisted transactionally, so restarting the application does not deliberately reset this protection. A verified assertion may remain consumed even when later request validation fails, so correcting metadata requires signing a new statement.
The second path skips dynamic registration. UDAP JWT Client Authentication section 8.1 describes an option for trust communities that can determine an unregistered client's identity and privileges from certificate attributes and define a reserved subject value. This POC uses a local convention in which both issuer and subject are unregistered.
The certificate still resolves to an approved, active agent. The service checks its signing key, status, ceiling and live policy. No client registration record is created for that path. Skipping registration therefore removes one lifecycle record; it does not remove identity approval or authorisation checks.
Next in the series
A valid client assertion establishes the identity proof. It does not make every requested scope acceptable, and it does not explain how an issued token responds to later policy changes. Those are the authorisation decisions in Part 4.
Top comments (0)