Sign in with Italy

SPID bent a standard until standard software broke, then split it across twelve companies that now need paying. What one OpenID provider would have looked like.

Adding “Sign in with Google” to a web application is an afternoon of work, and most of that afternoon goes on the consent screen rather than the code: you create a client in the Cloud Console, paste a redirect URI, point a library at one well-known URL, and from then on every login comes back as a signed token that your server checks against a set of public keys Google publishes and rotates on its own. Nobody signs a contract, nobody sends an invoice, and the library you used is the same one everybody else uses, because the protocol underneath (OpenID Connect) is the same everywhere it runs.

Adding “Entra con SPID” to the same application, if you are a private company, means a convention with AgID, a certificate carrying the right policy OIDs from AgID’s own federation PKI, a set of metadata extensions in an Italian namespace, a validator that runs more than three hundred checks, and then a wait, because approved metadata reach the identity providers in a batch that AgID pushes every working day at 18:00, which the providers then load “within one working day”. After that you pay, per user per year, each of the twelve companies whose logo sits in the dropdown. And since January your users may be paying too, because the largest provider, which holds most of the identities in the country, now asks six euros a year to keep one active.

Two routes to accepting a login, as a private company. The upper one, headed Sign in with Google, an afternoon and the library everybody else uses, is four boxes: create a client in the Cloud Console, paste a redirect URI once, read the discovery URL at well-known openid-configuration, and end in a black box reading signed ID token, checked against published keys. The lower one, headed Entra con SPID as a private company, a convention, a validator, a batch window and twelve invoices, runs over two lines: an AgID convention signed first, an AgID certificate with policy OID 1.3.76.16.4.3.1, SPID metadata with SPID extensions and a billing block, the SPID validator with more than 300 checks, then an AgID review repeated if anything changes, a metadata batch at 18:00 Monday to Friday, identity providers loading it within one working day, and a black box reading twelve invoices, per user, per year, per IdP. A line beneath reads: both routes end in a signed assertion, one of them also ends in a billing relationship.
TWO ONBOARDINGS The same job, accepting a verified login, as a private company would do it on each side. Both routes end in a signed assertion. Only one of them ends in twelve invoices.

Almost all of that was avoidable, I think, although getting there took me longer than I expected, because the first version of this argument I had in my head (Italy ignored the standards and invented its own thing) turned out to be wrong, and wrong in a way that taught me something, since the version that replaced it is, if anything, worse for the people who designed the system.

Twelve logos and a standard

SPID went live on 15 March 2016, on the basis of a decree from October 2014, and it is built on SAML 2.0, which is not an Italian invention at all: it is an OASIS standard from March 2005, the same protocol that half the world’s universities and a good share of enterprise single sign-on still run on. AgID’s own technical rules say so on their first page, which is enough to dispose of the charge that Italy “made up its own protocol” (a charge I was ready to make myself when I started writing this).

What Italy did make up is the architecture around the protocol, in which the state runs no identity provider at all and the job goes instead to twelve accredited private companies (most of them in the business of digital certificates and trust services), each of which verifies citizens on its own, issues its own credentials, runs its own login page and signs its own assertions, while AgID sits in the middle as the authority that accredits them, writes the rules and keeps the registry of who is allowed to talk to whom. A service that accepts SPID has to accept all twelve, which is why the login button is a dropdown of logos, and why the button has its own guidelines (the list in it has to stay in sync with the registry, by an AgID notice of January 2023).

Keep that shape in mind, because almost everything below follows from it: the protocol choice, the cost, the frauds, and the fact that the OpenID version Italy eventually wrote has, as far as I can tell, nobody on it.

How far SPID drifts from SAML

If SPID were plain SAML, the twelve-provider design would be a governance problem and nothing more, since any SAML library would plug into it; what SPID actually is, though, is a profile, which on its own would be normal (every serious federation constrains the base spec), except that this one constrains it in places where the standard said something else, and AgID’s own rules occasionally admit as much. On the NameQualifier attribute of the request’s issuer, for example, the technical rules state, in so many words, that making it mandatory “differs from what the SAML specifications provide”.

Some of the other choices are stranger. The levels of assurance are custom URIs (https://www.spid.gov.it/SpidL2 and friends) rather than standard authentication context classes. The SessionIndex, which SAML single logout relies on to know which session to end, is required at level 1 and must be absent at levels 2 and 3. The service provider’s metadata need a contact block with elements from https://spid.gov.it/saml-extensions (IPA code, VAT number, a flag saying whether you are public or private), and a private provider needs a second block with the data for electronic invoicing, which is not something I ever expected to find inside a SAML metadata file. And the official validator, spid-saml-check, enforces restrictions that are not in the rules at all: it rejects an AllowCreate attribute even though a later AgID notice removed any constraint on it.

The most honest summary of where this leaves an integrator comes from a 2021 analysis by M. Molinari for the IDEM/GARR working group, the people who run federated login for Italian universities and who therefore know SAML better than almost anyone in the country. Their conclusion, translated: an industry-standard SAML 2.0 implementation can only with great difficulty be used as-is for SPID, and whoever integrates it has to become a SAML expert in order to write extensions, forks and adaptations. The software around SPID bears that out: Keycloak needs a dedicated provider, maintained under the italia GitHub organisation, whose README notes that “the SPID specifications deviate from the SAML2 standard in some key aspects”. In 2018 a thread on the official developer forum concluded that Shibboleth’s service provider, which is about as standard as SAML software gets, could not be used in the SPID circuit at all because of how it handled the transient name ID policy. There are separate SPID libraries for PHP (wrapping SimpleSAMLphp and patching php-saml), Django, .NET, Spring and Express, and a proxy, Satosa-Saml2Spid, whose whole purpose is to translate plain SAML into SPID for services that cannot cope.

The accurate version of my original complaint, then, is that Italy took a standard and edited it until the standard software stopped working, which is worse than inventing a protocol outright (that would at least have been an honest decision, with honest costs), because it gives you the cost of a bespoke protocol without the freedom of having designed one.

There is a security cost too, and it belongs to SAML in general more than to SPID. SAML signs XML, and XML signatures sign a reference to part of a document after canonicalising it, which means the bytes that were signed and the bytes your application reads are chosen by two different processes. In 2012 Somorovsky and colleagues showed at USENIX Security that eleven out of fourteen major SAML frameworks could be fooled by wrapping a forged assertion around a genuine signed one, and the class has never gone away: ruby-saml had two critical signature-wrapping CVEs in March 2025, and in February 2025 SPID.AspNetCore.Authentication, one of the SPID-specific libraries, got a critical advisory (CVE-2025-24894) because it did not make sure the first signature actually covered the root element, which is the kind of mistake that every fork and adaptation the profile forces on people gives one more place to live.

What the same login looks like in OpenID Connect

OpenID Connect is OAuth 2.0 with an identity layer on top, and the parts that matter here are small enough to list. The provider publishes a discovery document at /.well-known/openid-configuration and its current public keys at a jwks_uri, so a relying party never exchanges metadata files by email. The user comes back with an ID token, a JSON Web Token signed with JWS, and in JWS the signature covers exactly the base64url bytes that you decode and read, which removes the wrapping problem by construction (JWT has had its own embarrassments, the alg: none and key-confusion bugs of 2015 among them, so I am not claiming the stack is immune to bad libraries, only that this particular class of attack has nowhere to stand). Native apps are covered by PKCE and RFC 8252, which matters in a country where most people log in to public services from a phone, and for which SAML has never had a practical answer.

The onboarding model I wanted for Italy is also already in the spec, and it is close to what GOV.UK One Login and Login.gov do today. A relying party proves who it is (a company registration, a privacy notice, a short technical check, the kind of certification an agency can do in a week), then registers a client and publishes its own public key, and from that point on it authenticates to the provider with private_key_jwt, signing a short assertion with its private key, so that there is no shared secret to leak and revoking a misbehaving client is one line in a database. The provider returns the fiscal code and whatever attributes the client was approved for, signed with keys anybody can fetch, and that is the whole relationship, with nothing in it that calls for a dropdown, a daily metadata batch or a billing address in the protocol.

“OpenID was not ready in 2014”

The obvious defence of the 2014 choice is that OpenID Connect was too young, and it is worth taking seriously because it is half true. OpenID Connect Core 1.0 was finalised in February 2014, eight months before the SPID decree, but the surrounding RFCs were not: JWT itself (RFC 7519) and PKCE (RFC 7636) only arrived in 2015, the native-apps best practice in 2017, the JWT best practices in 2020. A conservative architect in 2014 had reasons to pick the protocol with a decade of government deployments behind it.

The trouble with that defence is France. FranceConnect was designed from the summer of 2014, as an OpenID Connect hub with relying parties as OIDC clients and identity providers behind it as OIDC providers, and it went live on 28 March 2016, thirteen days after SPID, so that two neighbouring countries, working in the same months with the same standards in front of them, made opposite choices, and only one of them picked the protocol the rest of the industry was moving to. Today FranceConnect reports more than forty million active users and more than 1,500 connected services.

The better defence is eIDAS. The cross-border nodes that let a citizen of one EU country log in to another country’s services were specified in SAML, so a SAML-based national scheme had a shorter path to notification, and SPID was in fact notified under eIDAS in 2018 at all three levels. I think that is a real reason and I would have weighed it. It explains why SPID speaks SAML at its border, which is a gateway’s job, and it does not explain why every Italian municipality, bank and pharmacy chain had to speak a modified SAML internally.

The part Google does not do

The strongest argument against me is that Google does not know who you are, and I would rather make it properly than have it made at me. “Sign in with Google” tells a relying party that the same Google account is back, and email_verified tells it the email works; Google’s own documentation says the name claim is “never guaranteed to be present”, and nothing in the token is a legal identity, a fiscal code, or an eIDAS level of assurance. The protocol is cheap because it carries a cheap assertion. The expensive part of a national identity system is identity proofing (somebody, or something, checking a document against a face, once per citizen, and then handling lost phones, forgotten PINs, fraud and a helpdesk forever), and none of that gets cheaper because you swapped XML for JSON.

The budgets of other countries say the same thing. When the UK built GOV.UK Verify, a federation of private certified identity providers very close to the SPID model, the National Audit Office found in 2019 that the government was paying the providers around twenty pounds per newly verified user, against a target of about one. Login.gov charges American agencies three dollars per user in a year that includes proofing and one dollar in the years that do not. Even FranceConnect, which is free for users and for services, becomes a paid service at its higher-assurance tier, FranceConnect+, where the relying party has to contract with the identity providers and is billed per use. If my argument were that OpenID Connect makes identity free, every one of those budgets would prove it wrong.

The proofing Italy had already paid for

My argument is narrower than that, and I think it survives. Italy already does in-person identity proofing for nearly everyone, at the municipal registry office, when it issues the electronic identity card. There were 57.4 million valid CIE cards by September 2026, against 43.4 million SPID identities issued, and each of those cards was produced after a public official compared a face with a person and a person with a record. The state paid for the expensive part already, once, through an office it was going to run anyway.

SPID then pays for it again, twelve times over, through twelve private companies, each of which runs its own recognition process (at a counter, through a live webcam call, or through a recorded video confirmed afterwards by a bank transfer, a procedure that since 2020 has not even needed a live operator) and each of which can issue a valid identity for the same fiscal code without the others knowing. That last property is exactly where the frauds came from. The cases around the youth culture bonus were built on “parallel” SPIDs: in Trieste in 2023 prosecutors described fake identities opened at a different provider from the victim’s, and in Florence in June 2025 investigators reported more than 2,500 irregular identities and about 400,000 euros diverted, activated through registration offices that were run by the fraudsters themselves. The duplicated proofing is the cost, and it is also the attack surface, and the government’s own fix (a reform approved in preliminary form this week, under which each person may hold only one SPID for personal use, checked against the national population register) is an admission that the federation needed a single source of truth all along.

Two stacked diagrams. The upper one, headed what the state already does, a public official compares a face with a person once, runs from a box reading registry office, in person at the comune, to electronic ID card, 57.4 million valid cards, to a black box reading one verified identity, bound to the card's chip. The lower one, headed what SPID does on top of it, twelve companies each running its own recognition, is a grid of twelve boxes, numbered provider 1 to provider 12, each labelled own recognition, gathered by a bracket into one arrow pointing at a black box reading one fiscal code, up to one valid SPID per IdP. Beneath: none of the twelve sees the identities the others issued for the same person, which is the gap the bonus cultura frauds went through; the November 2026 reform caps it at one personal SPID per person, checked against ANPR.
CHECKED ONCE The expensive part of identity, done once by the state and then twelve more times by the market, with no shared view of the result.

A state provider sitting on the CIE would have spent nothing extra on proofing, since the card already did it, and the login itself could have been anything the card’s holder could reasonably use: the NFC chip and PIN for the highest level, an app bound to the card once at enrolment for everyday use (which is roughly how CieID works today). I accept that the card’s own login has friction, since tapping a card on a phone and typing an eight-digit PIN is not something everybody manages on the first try, and I suspect a good part of SPID’s lead in usage comes from that. Friction in the authenticator, though, is a product problem, the kind you solve with a better app and a better enrolment flow, and rebuilding identity verification in a dozen private companies is a strange way to solve it.

Who pays for twelve identity providers

Which brings me to the money, and to the claim, common online and present in my own first draft, that “SPID is paid”. As worded it is wrong, and it is worth being exact. Public administrations have never paid to accept SPID. The convention every provider signs with AgID still obliges it to offer at least one way to obtain a level 1 and 2 identity for free, and spid.gov.it still says that using SPID is free for citizens. The sentence I can defend is narrower and, I think, more damning: SPID is a public service built on companies that were never given a way to be paid for it, and so they are now billing whoever they can reach.

They can reach two groups. Private service providers pay under a tariff AgID set in 2019: nothing for the first thousand unique users a year, then 40 cents per unique user per year for a basic login, 3.50 euros when the service also asks for extra attributes, seven euros at level 3, invoiced separately by every provider whose users showed up. For a bank or an insurer that is a line item. For a small company that wants to verify a customer’s age it is a reason to use something else, and nobody does this onboarding alone anyway: of the 40,093 service-provider entities in the SPID registry when I queried it this week, 34,402 (about 86 percent) are connected through an aggregator, an intermediary paid to absorb the profile, the certificates and the conventions on their behalf.

The other group is citizens, and the reason they are now paying is a dispute that has run since 2022. In December of that year the undersecretary for innovation, Alessio Butti, said the government would “gradually switch off” SPID in favour of the CIE. The providers answered that SPID had never been sustainable and asked for public money, and in 2023 a decree set aside up to 40 million euros from the recovery plan. The money moved slowly enough that in July 2025 the president of the providers’ trade association said “we have lost millions of euros on SPID over eight years”, and the Corte dei conti’s report of March 2026 shows where the 40 million stood at the end of 2025: twelve million transferred from the Department for Digital Transformation to AgID as an advance, and nothing committed or paid to any provider. Meanwhile the conventions were renewed in October 2025 until 2027, with an addendum in which AgID promised to “identify the source of funding” for the providers’ costs without naming one, and the providers stated publicly that they could now value their user base “according to market logic”.

Market logic arrived quickly. In 2025 one provider introduced a fee of 4.90 euros plus VAT a year from the second year, a second followed in July at 5.98 euros, and from 1 January 2026 the largest provider charges six euros a year after the first, with exemptions for minors, people over 75 and residents abroad. Il Sole 24 Ore counted 28.7 million of that provider’s users affected, out of about forty million identities. The Politecnico di Milano’s observatory reported in November that only 32 million SPID identities are still active, and that SPID logins in 2026 are running ten percent below 2025, a drop it links partly to the fees. There are still providers that charge nothing, and moving to one costs nothing either, although that assumes the person holding the identity knows they can move, and the people least likely to know are exactly the ones whose SPID was opened for them by a clerk at a counter.

The fees, in other words, come from the architecture, which is also (and this is the part that ties the two halves of this essay together) what dictated the wire format. FranceConnect and the UK’s One Login are OpenID Connect hubs run by the state and paid for out of the state’s budget as infrastructure, the way a road or a registry office is, and their relying parties integrate once with one provider. SPID’s protocol choice and its business model are the same decision seen from two sides: you only need a federation profile with billing contacts in the metadata if you have decided that identity will be produced by a market, and once you have decided that, somebody eventually has to pay the market.

The OpenID version exists, and it is empty

The detail that made me laugh (in the tired way) is that Italy did write the OpenID Connect version of SPID. AgID adopted guidelines for OpenID Connect in SPID in December 2021, based on the iGov profile, and made them mandatory for identity providers from 1 May 2022; a federation specification on top of OpenID Federation 1.0, with AgID as the trust anchor, followed in September 2022 and was revised in March 2025, which means that, on paper, my essay was answered four years ago.

In practice the SPID trust anchor publishes its configuration at registry.spid.gov.it/.well-known/openid-federation, and its list endpoint, which is supposed to enumerate the identity providers and relying parties in the federation, returned an empty array when I called it this week. The largest provider publishes an OpenID entity configuration pointing at the registry, but the trust anchor answers that no trust mark is available for it, and the other providers I tried return 404. On the developer forum in early 2025 the answer to an aggregator asking about it was blunt: OIDC works with CIE, not with SPID. Even the design, had it shipped, would not have been the afternoon with Google I opened with, since OpenID Federation (trust chains, entity statements, trust marks) is a much heavier machine than a client ID and a JWKS, and its 1.0 specification only became final in February 2026.

Two side-by-side panels. The left, headed SPID over OpenID Connect, rules since 2021, mandatory for IdPs since May 2022, shows a curl request to registry.spid.gov.it slash oidc slash list and, underneath in very large type, an empty pair of square brackets, labelled entities in the federation. The right, headed CieID over OpenID Connect, one provider run by the state, shows a curl request to oidc.registry.servizicie.interno.gov.it slash list and, underneath in the same large type, 3,698, labelled entities, some of them test. A footer reads: both trust anchors' list endpoints, queried on 29 November 2026.
TWO FEDERATIONS The same question asked of both OpenID trust anchors: the SPID one, with rules on the books since 2021, answers with an empty list, and the state's own CieID answers with a working federation.

On the CIE side, meanwhile, things work: the Ministry of the Interior runs a CieID trust anchor whose list returned 3,698 entities when I queried it (some of them test entities), relying parties authenticate with signed requests and their own keys, and the same observatory counted 265.8 million CieID accesses so far this year. It still serves its production configuration with placeholder details left over from a local test setup, an organisation name ending in “Locale” and a contact address on a .local domain, which is the kind of thing that tells you a system was built under deadline by people who then moved on, and it works anyway, because a single provider on a standard protocol has very few places to break.

So the thing I wanted exists, it is run by the state, it is free to the citizen beyond the price of the card, and it speaks OpenID Connect. It runs alongside SPID instead of replacing it, and the reform the government approved this week tightens SPID (one identity per person, stricter issuance) rather than winding it down, even though Butti told Parliament in July 2025 that the goal was to switch it off “progressively” over two or three years.

What I would have built

I would have built one identity provider, run by the state and sitting on the identity card the state already issues, speaking OpenID Connect to every relying party, public or private, after a short certification that checks who the relying party is and what it needs, with a registered public key, private_key_jwt, and scopes that decide which attributes each client can ever see. At the border I would have put a SAML gateway for eIDAS, because that is what the border spoke in 2016. I would have charged no per-user tariff, since the cost of authenticating a citizen to a pharmacy or a bank is a rounding error next to the cost of the identity card, and the identity card is already paid for. And if the state really wanted a market (there are good reasons to want more than one way to log in, starting with not having a single point of failure for the whole country), I would have let private providers plug in behind the hub, the way several identity providers, private ones among them, sit behind FranceConnect, competing on authenticators and on user experience instead of each re-verifying the same population from scratch.

None of this is a new idea, and that is the part that frustrates me. The UK built Verify on the federated model, spent years paying twenty pounds a head for it, and replaced it with a state OpenID Connect provider. France built the hub in the same months Italy built the federation. Europe’s identity wallet, due in every member state by the end of this year, issues and presents credentials over OpenID4VCI and OpenID4VP, which are OpenID protocols, so the direction of the whole continent has been visible for a while. Italy saw it too, wrote it down in 2021, and published an OpenID federation for SPID whose list of members, as of this week, is [].