# Response examples and parameters

You use SPID to verify the end-user identity and obtain relevant personal data. This page shows response code examples with property descriptions for the OIDC protocol.

# OIDC response example

This section shows response examples for the UserInfo endpoint. You can find detailed scopes and claims descriptions below.

# Example of natural person

Example for the test user (opens new window) Ada Lovelace:

{
    "idp_id": "SPID-0020020020",
    "nin": "TINIT-LVLDAA85T50G702B",
    "nin_type": "TAX",
    "nin_issuing_country": "IT",
    "spid_place_of_birth": "G702",
    "spid_county_of_birth": "PI",
    "spid_id_card": "passaporto KK1234567 questuraLivorno 2016-09-04 2026-09-03",
    "given_name": "Ada",
    "family_name": "Lovelace",
    "birthdate": "1985-12-10",
    "gender": "F",
    "phone_number": "3939393939",
    "spid_expiration_date": "02/02/2018 00:00:00",
    "address": {
        "formatted": "Via Listz 21, Roma, RM, 00144, IT",
        "street_address": "Via Listz 21",
        "locality": "Roma",
        "postal_code": "00144",
        "country": "IT"
    },
    "email": "aabyron@hotmail.com",
    "idp_issuer": "https://demo.spid.gov.it"
}

# Example of organisation

Example of a response containing the organisation claim:


{
    "spid_place_of_birth": "Roma",
    "spid_county_of_birth": "RM",
    "organisation": "Agenzia per l'Italia Digitale",
    "spid_registered_office": "Via Listz 21 00144 Roma",
    "spid_company_fiscal_number": "TINIT-GDASDV00A01H501J",
    "spid_iva_code": "VATIT-97735020584",
    "spid_id_card": "CartaIdentità AA00000000 ComuneRoma 2018-01-01 2028-01-01",
    "given_name": "SpidValidator",
    "family_name": "AgID",
    "birthdate": "2000-01-01",
    "gender": "M",
    "phone_number": "+393331234567",
    "spid_digital_address": "pec@pecagid.gov.it",
    "spid_expiration_date": "2028-01-01",
    "address":
    {
        "formatted": "Via Listz 21, Roma, RM, 00144, IT",
        "street_address": "Via Listz 21",
        "locality": "Roma",
        "postal_code": "00144",
        "country": "IT"
    },
    "email": "spid.tech@agid.gov.it",
    "sub": "ZZ0eRjWltcKswng6W-6....y-DDc1AwSEUP7C2aMZtw=",
    "sub_legacy": "z507Ae7ecG282uDCSHiYa1Evt-Ryvq0ymKJqcdnzcTk=",
    "idp_issuer": "https://demo.spid.gov.it/validator "
}

# Scopes and claims mapping for OIDC

By default, all claims listed in this table are returned in the UserInfo endpoint. It is also possible to configure "Id Token User Data" for the client (when setting up the security of the OIDC client) so the claims are returned in both the ID token and the UserInfo. The table below provides an overview of OIDC scopes and claims to access information for specific SPID data categories.

Scope Claim Description Example SPID data category
spid idp_id The IdP (SPID) code of the user. Format is <code_IdP><N_DIGITS> where code_IdP is a four characters code unique for the identity provider. ABCD-123456789A Personal data
family_name The surname of the user. Lovelace Personal data
given_name The first name of the user. Ada Personal data
birthdate The date of birth of the user (format YYYY-MM-DD). 1985-12-10 Personal data
gender The biological sex of the user (M or F). F Personal data
spid_place_of_birth The place of birth of the user. A string corresponding to the codice Belfiore of the municipality or foreign country. For example, F205 for the city of Milan. G702 Personal data
spid_county_of_birth The county (province) of birth of the user. For example, MI for the county of Milan. Returns EE for citizens born abroad. PI Personal data
organisation The registered name of a company. For example, Agenzia per l’ Italia Digitale. Personal data
spid_registered_office The registered address of a company. via Listz 21 00144 Roma Personal data
spid_company_fiscal_number The fiscal code of the legal person (TINIT-<CodiceFiscale>). TINIT-LVLDAA85T50G702B Personal data
spid_iva_code The VAT identification number of a company. Format: VATIT-<PartitaIVA>. Personal data
spid_id_card The information on the identity document of the user. The claim returns a single-spaced concatenated string with the format
<document_type> <document_number> <issuer> <issue_date> <expiration_date>, where:
  • document_type is the type of document. Accepted values are cartaIdentita, passaporto, patenteGuida, patenteNautica, librettoPensione, patentinoImpTermici, portoArmi, tesseraRiconoscimento.
  • document_number is the document number.
  • issuer is a concatenated string containing the major parts of the name of the issuing entity. For example, provinciaCatania (Provincia di Catania).
  • issue_date is the document issue date in YYYY-MM-DD format.
  • expiration_date is the document expiration date in YYYY-MM-DD format.
passaporto KK1234567 questuraLivorno 2016-09-04 2026-09-03 Personal data
nin nin The national identity number (“Codice Fiscale”/ Fiscal Code) of the user. This is the same as fiscalNumber; format is TINIT-<CodiceFiscale>. TINIT-LVLDAA85T50G702B Personal data
nin_type The type of national identity number. Always TAX for SPID. TAX Personal data
nin_issuing_country The issuing country of the national identity. Always IT for SPID. IT Personal data
spid-extra phone_number The phone number of the user. 3939393939 Extra personal data
spid_digital_address PEC (Posta Elettronica Certificata/Certified email address) address. Extra personal data
spid_expiration_date Identity expiration date. Format is DD/MM/YYYY HH:MM:SS 02/02/2018 00:00:00 Extra personal data
address The residential address of the user.

"formatted" value is obtained concatenating multiple attributes with format domicileStreetAddress, domicileMunicipality, domicileProvince, domicilePostalCode, domicileNation, where:
  • domicileStreetAddress is composed of
    • type: via, viale, piazza
    • street name
    • house nr (or "Nr. civico")
  • domicileMunicipality is the name of the municipality (or "Comune")
  • domicileProvinceis the 2-characters county code (or province)
  • domicilePostalCode is the 5-digit long postal code (or "CAP")
  • domicileNation is the country code
{
"formatted": "Via Listz 21, Roma, RM, 00144, IT",
"street_address": "Via Listz 21",
"locality": "Roma",
"postal_code": "00144",
"country": "IT"
}
Extra personal data
email The email address of the user. aabyron@hotmail.com Extra personal data

SPID attributes table

For further details about attributes and data formats, see the official SPID documentation (opens new window).

Last updated: 11/04/2024 07:47 UTC