You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
.NET implementation of **OAuth2** authentication for **PDND**service with client assertion generation.
11
+
A .NET implementation of **OAuth 2.0**client authentication for **PDND**(Piattaforma Digitale Nazionale Dati), including client assertion (JWT) generation and voucher retrieval.
12
12
13
13
## Contents
14
-
-[PDND](#pdnd)
14
+
-[What is PDND?](#what-is-pdnd)
15
15
-[Voucher](#voucher)
16
16
-[Requesting a Voucher](#requesting-a-voucher)
17
17
-[How to Use the Client Assertion Generator](#how-to-use-the-client-assertion-generator)
18
-
-[Licensee](#licensee)
18
+
-[Voucher Flow for Interoperability APIs](#voucher-flow-for-interoperability-apis)
19
+
-[Security Notes](#security-notes)
20
+
-[License](#license)
19
21
-[Contact](#contact)
20
22
21
-
## PDND
23
+
## What is PDND?
22
24
The **[Piattaforma Digitale Nazionale Dati (PDND)](https://developers.italia.it/it/pdnd/)** is an Italian digital infrastructure designed to facilitate **data interoperability** and exchange between public administrations and private entities. The platform aims to simplify the sharing of public data by providing a secure, standardized, and centralized system for data integration, access, and management. PDND promotes digital transformation within the public sector by ensuring data is accessible, reliable, and reusable, enabling more efficient public services, enhancing transparency, and supporting **data-driven decision-making** for both government and citizens.
23
25
24
26
## Voucher
25
-
Vouchers are simple JWT tokens. The implemented authentication flow is OAuth 2.0, which refers to [**RFC6750**](https://datatracker.ietf.org/doc/html/rfc6750) for the use of Bearer tokens and to [**RFC7521**](https://datatracker.ietf.org/doc/html/rfc7521) for client authorization via client assertion.
27
+
A **voucher** is a JWT used as a Bearer token to access PDND Interoperability APIs.
-[**RFC7521**](https://datatracker.ietf.org/doc/html/rfc7521) (client authorization via client assertion)
33
+
34
+
To request a voucher, the client must:
35
+
1. Register at least one public key on the PDND client.
36
+
2. Create a client assertion (JWT) and sign it with the corresponding private key.
37
+
3. Exchange the assertion for a voucher at the authorization endpoint.
26
38
27
39
## Requesting a Voucher
28
40
To obtain a valid voucher, you must first upload at least one public key to an interop API client. The first step is to create a valid client assertion and sign it with your private key (which must match the public key registered with the client on PDND Interoperabilità). The client assertion consists of a header and a payload.
29
41
30
42
## Voucher Flow for Interoperability APIs
31
-
The user requests a voucher. Once obtained, they include it as an authorization header in subsequent calls to the PDND Interoperability APIs.
43
+
1. Your system requests a voucher using a signed client assertion.
44
+
2. On success, include the returned voucher in the Authorization: Bearer <token> header when calling PDND Interoperability APIs.
32
45
33
46
## How to Use the Client Assertion Generator
34
47
To properly set up and use the Client Assertion Generator in your ASP.NET Core application, follow these steps:
@@ -39,14 +52,14 @@ To properly set up and use the Client Assertion Generator in your ASP.NET Core a
"Duration": "600" // Duration is expressed in milliseconds
50
63
},
51
64
```
52
65
@@ -81,7 +94,13 @@ If you'd like to contribute, please fork, fix, commit and send a pull request fo
81
94
*[Fork the repository](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/fork-a-repo)
82
95
*[Open an issue](https://github.com/italia/pdnd-client-assertion-generator/issues) if you encounter a bug or have a suggestion for improvements/features
83
96
84
-
## Licensee
97
+
## Security Notes
98
+
- Never commit private keys or secrets to the repository.
99
+
- Prefer environment variables or secret stores for sensitive values.
100
+
- Rotate keys regularly and restrict file permissions on KeyPath.
101
+
- Validate token lifetimes appropriate to your risk profile.
102
+
103
+
## License
85
104
Repository source code is available under MIT License, see license in the source.
0 commit comments