Pdnd Test Client
A console application in .NET 9 designed to test interoperability with the PDND — Piattaforma Digitale Nazionale Dati (the National Digital Data Platform), the infrastructure that allows Italian public administrations to exchange data through APIs.
The project implements, in a streamlined way, the authentication and invocation flow required by PDND: building the client assertion, requesting the OAuth2 voucher, and calling the target e-service.
What it does
Builds a signed client assertion
It loads an RSA key from a
.pfxcertificate and generates a signed JWT with the claims required by PDND, includingpurposeIdandiss/subset to the client ID.Requests the PDND voucher
It sends the client assertion to the authorization endpoint using the
client_credentialsgrant type and receives an access token in response, that is, the voucher used to access the e-service.Calls the e-service
It uses the voucher as a Bearer token to call the target service's API, logging the entire HTTP exchange so you can analyze the request, response, headers, and payload.
Technical details
Configuration is externalized in appsettings.json: endpoint, client ID, purpose ID, and certificate path are kept separate from the application code.
Secrets, certificates, and private keys are kept out of version control.
A custom HTTP handler intercepts and logs inbound and outbound traffic, masking the authorization token. This makes it possible to debug the flow without exposing sensitive credentials in the logs.
Why it's interesting
The project shows, without heavy frameworks or unnecessary abstractions, how to connect to a real public infrastructure.
The point is not to hide the complexity, but to make it readable: the signed JWT, the OAuth2 voucher, the HTTP call to the e-service, and traffic logging are highlighted step by step.
It is a practical reference for understanding what really happens when a client application authenticates with PDND and consumes a service exposed through the platform.