Skip to content

Commit

Permalink
Merge pull request #37 from peppelinux/agid-updates
Browse files Browse the repository at this point in the history
Aggiornamento con Avvisi AgID
  • Loading branch information
alranel authored Feb 9, 2021
2 parents 4e2732e + da47b2e commit da3c05c
Show file tree
Hide file tree
Showing 9 changed files with 642 additions and 127 deletions.
23 changes: 23 additions & 0 deletions attributi.rst
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,22 @@ Il tipo sotto indicato è il valore dell’attributo ``xsi:type`` dell’element
- ``email``
- xs:string
- Formato standard indirizzo di posta elettronica
* - Domicilio
- ``domicileStreetAddress``
- xs:string
- via, viale, piazza
* - Codice Postale
- ``domicilePostalCode``
- xs:string
- CAP
* - Comune
- ``domicileMunicipality``
- xs:string
- Comune
* - Provincia
- ``domicileProvince``
- xs:string
-
* - Domicilio fisico
- ``address``
- xs:string
Expand All @@ -143,6 +159,10 @@ Il tipo sotto indicato è il valore dell’attributo ``xsi:type`` dell’element
* CAP;
* Luogo;
* Provincia.
* - Nazione
- ``domicileNation``
- xs_string
-
* - Data di scadenza identità
- ``expirationDate``
- xs:date
Expand All @@ -152,3 +172,6 @@ Il tipo sotto indicato è il valore dell’attributo ``xsi:type`` dell’element
- xs:string
- Indirizzo casella PEC


.. warning::
L'attributo `address` è stato sostituito dall `Avviso AgID n25 <https://www.agid.gov.it/sites/default/files/repository_files/spid-avviso-n25-nuova-codifica-domicilio_fisico.pdf>`_
33 changes: 33 additions & 0 deletions code-samples/idp-metadata.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<md:EntityDescriptor xmlns:md = "urn:oasis:names:tc:SAML:2.0:metadata"
xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion"
xmlns:xsi="http://www.w3.org/2001/XMLSchemainstance"
xmlns:fpa="https://spid.gov.it/invoicing-extensions"
xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata"
entityID="http://spid.identityprovider.it"
ID="_2ini49248n98dn984n...">
<ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
Expand Down Expand Up @@ -39,4 +41,35 @@
<saml:Attribute xsi:type="xsi:string" Name="address"/>
<saml:Attribute xsi:type="xsi:string" Name="digitalAddress"/>
</md:IDPSSODescriptor>
<md:Organization>
<md:OrganizationName xml:lang="it">SPID Identity Provider</md:OrganizationName>
<md:OrganizationDisplayName xml:lang="it">SPID Identity Provider</md:OrganizationDisplayName>
<md:OrganizationURL xml:lang="it">https://spid.identityprovider.it</md:OrganizationURL>
</md:Organization>
<md:ContactPerson contactType="billing">
<md:Extensions>
<fpa:CessionarioCommittente>
<fpa:DatiAnagrafici>
<fpa:IdFiscaleIVA>
<fpa:IdPaese>IT</fpa:IdPaese>
<fpa:IdCodice>983745349857</fpa:IdCodice>
</fpa:IdFiscaleIVA>
<fpa:Anagrafica>
<fpa:Denominazione>Destinatario Fatturazione</fpa:Denominazione>
</fpa:Anagrafica>
</fpa:DatiAnagrafici>
<fpa:Sede>
<fpa:Indirizzo>via tante cose</fpa:Indirizzo>
<fpa:NumeroCivico>12</fpa:NumeroCivico>
<fpa:CAP>87100</fpa:CAP>
<fpa:Comune>Cosenza</fpa:Comune>
<fpa:Provincia>CS</fpa:Provincia>
<fpa:Nazione>IT</fpa:Nazione>
</fpa:Sede>
</fpa:CessionarioCommittente>
</md:Extensions>
<md:Company>example s.p.a.</md:Company>
<md:EmailAddress>[email protected]</md:EmailAddress>
<md:TelephoneNumber>+39 84756344785</md:TelephoneNumber>
</md:ContactPerson>
</md:EntityDescriptor>
248 changes: 182 additions & 66 deletions code-samples/response.xml
Original file line number Diff line number Diff line change
@@ -1,67 +1,183 @@
<samlp:Response xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol"
xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion"
ID="_66bc42b27638a8641536e534ec09727a8aaa"
Version="2.0"
InResponseTo="_4d38c302617b5bf98951e65b4cf304711e2166df20"
IssueInstant="2015-01-29T10:01:03Z"
Destination="http://spid-sp.it">
<saml:Issuer NameQualifier="”https://spidIdp.spidIdpProvider.it”
Format=" urn:oasis:names:tc:SAML:2.0:nameid-format:entity">
spididp.it
</saml:Issuer>
<ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
.............
</ds:Signature>
<samlp:Status>
<samlp:StatusCode Value="urn:oasis:names:tc:SAML:2.0:status:Success" />
</samlp:Status>
<saml:Assertion xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion"
ID="_27e00421b56a5aa5b73329240ce3bb832caa"
IssueInstant="2015-01-29T10:01:03Z" Version="2.0">
<saml:Issuer Format="urn:oasis:names:tc:SAML:2.0:nameid-format:entity">
spididp.it
</saml:Issuer>
<ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
......
</ds:Signature>
<saml:Subject>
<saml:NameID Format="urn:oasis:names:tc:SAML:2.0:nameid-format:transient"
NameQualifier="http://spidIdp.spididpProvider.it">
_06e983facd7cd554cfe067e
</saml:NameID>
<saml:SubjectConfirmation Method="urn:oasis:names:tc:SAML:2.0:cm:bearer">
<saml:SubjectConfirmationData Recipient="https://spidSP.serviceProvider.it/"
NotOnOrAfter="2001-12-31T12:00:00"
InResponseTo="_4d38c302617b5bf98951e65b4cf304711e2166df20">
</saml:SubjectConfirmationData>
</saml:SubjectConfirmation>
</saml:Subject>
<saml:Conditions NotBefore="2015-01-29T10:00:33Z"
NotOnOrAfter="2015-01-29T10:02:33Z">
<saml:AudienceRestriction>
<saml:Audience>
https://spidSP.serviceProvider.it
</saml:Audience>
</saml:AudienceRestriction>
</saml:Conditions>
<saml:AuthnStatement AuthnInstant="2015-01-29T10:01:02Z">
<saml:AuthnContext>
<saml:AuthnContextClassRef>
https://www.spid.gov.it/SpidL1
</saml:AuthnContextClassRef>
</saml:AuthnContext>
</saml:AuthnStatement>
<saml:AttributeStatement xmlns:xsi="http://www.w3.org/2001/XMLSchemainstance">
<saml:Attribute Name="familyName">
<saml:AttributeValue xsi:type="xsi:string">
Rossi
</saml:AttributeValue>
</saml:Attribute>
<saml:Attribute Name="spidCode">
<saml:AttributeValue xsi:type="xsi:string">
ABCDEFGHILMNOPQ
</saml:AttributeValue>
</saml:Attribute>
</saml:AttributeStatement>
</saml:Assertion>
<samlp:Response Destination="https://that.spid.example.org/saml2/acs/post" ID="_5e728601-9ad4-4686-b269-81d107a8194a" InResponseTo="id-wr6bt7ZpfqiYVrqTd" IssueInstant="2021-02-04T15:41:59Z" Version="2.0" xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion" xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol">
<saml:Issuer Format="urn:oasis:names:tc:SAML:2.0:nameid-format:entity">
http://localhost:8080
</saml:Issuer>
<ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
<ds:SignedInfo>
<ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
<ds:SignatureMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"/>
<ds:Reference URI="#_5e728601-9ad4-4686-b269-81d107a8194a">
<ds:Transforms>
<ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/>
<ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
</ds:Transforms>
<ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/>
<ds:DigestValue>
...
</ds:DigestValue>
</ds:Reference>
</ds:SignedInfo>
<ds:SignatureValue>
...
</ds:SignatureValue>
<ds:KeyInfo>
<ds:X509Data>
<ds:X509Certificate>
...
</ds:X509Certificate>
</ds:X509Data>
</ds:KeyInfo>
</ds:Signature>

<samlp:Status>
<samlp:StatusCode Value="urn:oasis:names:tc:SAML:2.0:status:Success"/>
</samlp:Status>

<saml:Assertion ID="_bebbed6a-2f6c-43d9-b151-f214d0c61de0" IssueInstant="2021-02-04T15:41:59Z" Version="2.0" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<saml:Issuer Format="urn:oasis:names:tc:SAML:2.0:nameid-format:entity">
https://that.spid.idp.example.org/metadata
</saml:Issuer>
<ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
<ds:SignedInfo>
<ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
<ds:SignatureMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"/>
<ds:Reference URI="#_bebbed6a-2f6c-43d9-b151-f214d0c61de0">
<ds:Transforms>
<ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/>
<ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
</ds:Transforms>
<ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/>
<ds:DigestValue>
6V8qWljmWULO0C0OQit0DaylE+neFN9K8SXR2izWXpw=
</ds:DigestValue>
</ds:Reference>
</ds:SignedInfo>
<ds:SignatureValue>
...
</ds:SignatureValue>
<ds:KeyInfo>
<ds:X509Data>
<ds:X509Certificate>
...
</ds:X509Certificate>
</ds:X509Data>
</ds:KeyInfo>
</ds:Signature>

<saml:Subject>
<saml:NameID Format="urn:oasis:names:tc:SAML:2.0:nameid-format:transient" NameQualifier="https://validator.spid.gov.it">
_655df4bc-b372-475e-906d-e71e4d7e98de
</saml:NameID>
<saml:SubjectConfirmation Method="urn:oasis:names:tc:SAML:2.0:cm:bearer">
<saml:SubjectConfirmationData InResponseTo="id-wr6bt7ZpfqiYVrqTd" NotOnOrAfter="2021-02-04T15:46:51Z" Recipient="https://that.spid.example.org/saml2/acs/post"/>
</saml:SubjectConfirmation>
</saml:Subject>

<saml:Conditions NotBefore="2021-02-04T15:41:59Z" NotOnOrAfter="2021-02-04T15:46:51Z">
<saml:AudienceRestriction>
<saml:Audience>
http://that.spid.example.org/saml2/metadata
</saml:Audience>
</saml:AudienceRestriction>
</saml:Conditions>

<saml:AuthnStatement AuthnInstant="2021-02-04T15:41:59Z" SessionIndex="_ec9c5b35-12dc-414d-ad09-5b4610934db8">
<saml:AuthnContext>
<saml:AuthnContextClassRef>
https://www.spid.gov.it/SpidL1
</saml:AuthnContextClassRef>
</saml:AuthnContext>
</saml:AuthnStatement>

<saml:AttributeStatement>

<saml:Attribute Name="spidCode" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic">
<saml:AttributeValue xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string">
AGID-001
</saml:AttributeValue>
</saml:Attribute>
<saml:Attribute Name="name" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic">
<saml:AttributeValue xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string">
SpidValidator
</saml:AttributeValue>
</saml:Attribute>
<saml:Attribute Name="familyName" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic">
<saml:AttributeValue xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string">
AgID
</saml:AttributeValue>
</saml:Attribute>
<saml:Attribute Name="placeOfBirth" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic">
<saml:AttributeValue xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string">
Roma
</saml:AttributeValue>
</saml:Attribute>
<saml:Attribute Name="countyOfBirth" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic">
<saml:AttributeValue xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string">
RM
</saml:AttributeValue>
</saml:Attribute>
<saml:Attribute Name="dateOfBirth" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic">
<saml:AttributeValue xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:date">
2000-01-01
</saml:AttributeValue>
</saml:Attribute>
<saml:Attribute Name="gender" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic">
<saml:AttributeValue xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string">
M
</saml:AttributeValue>
</saml:Attribute>
<saml:Attribute Name="companyName" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic">
<saml:AttributeValue xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string">
Agenzia per l'Italia Digitale
</saml:AttributeValue>
</saml:Attribute>
<saml:Attribute Name="registeredOffice" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic">
<saml:AttributeValue xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string">
Via Listz 21 00144 Roma
</saml:AttributeValue>
</saml:Attribute>
<saml:Attribute Name="fiscalNumber" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic">
<saml:AttributeValue xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string">
TINIT-GDASDV00A01H501J
</saml:AttributeValue>
</saml:Attribute>
<saml:Attribute Name="ivaCode" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic">
<saml:AttributeValue xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string">
VATIT-97735020584
</saml:AttributeValue>
</saml:Attribute>
<saml:Attribute Name="idCard" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic">
<saml:AttributeValue xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string">
CartaIdentità AA00000000 ComuneRoma 2018-01-01 2028-01-01
</saml:AttributeValue>
</saml:Attribute>
<saml:Attribute Name="expirationDate" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic">
<saml:AttributeValue xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:date">
2028-01-01
</saml:AttributeValue>
</saml:Attribute>
<saml:Attribute Name="mobilePhone" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic">
<saml:AttributeValue xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string">
+393331234567
</saml:AttributeValue>
</saml:Attribute>
<saml:Attribute Name="email" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic">
<saml:AttributeValue xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string">
[email protected]
</saml:AttributeValue>
</saml:Attribute>
<saml:Attribute Name="address" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic">
<saml:AttributeValue xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string">
Via Listz 21 00144 Roma
</saml:AttributeValue>
</saml:Attribute>
<saml:Attribute Name="digitalAddress" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic">
<saml:AttributeValue xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string">
[email protected]
</saml:AttributeValue>
</saml:Attribute>
</saml:AttributeStatement>
</saml:Assertion>

</samlp:Response>
55 changes: 55 additions & 0 deletions code-samples/sp-metadata-fatturazione.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<md:EntityDescriptor
entityID="https://entityID.unico/dell/SP"
ID="_uniqueID"
xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata"
xmlns:spid="https://spid.gov.it/saml-extensions">
<md:Organization>
<md:OrganizationName xml:lang="it">
Denominazione Completa dell'Organizzazione s.r.l.
</md:OrganizationName>
<md:OrganizationDisplayName xml:lang="it">
Organizzazione
</md:OrganizationDisplayName>
<md:OrganizationURL xml:lang="it">
https://organizzazione.com/it
</md:OrganizationURL>
</md:Organization>
<md:ContactPerson contactType="other">
<md:Extensions>
<spid:VATNumber>IT12345678901</spid:VATNumber>
<spid:FiscalCode>XYZABCAAMGGJ000W</spid:FiscalCode>
<spid:Private/>
</md:Extensions>
<md:EmailAddress>[email protected]</md:EmailAddress>
<md:TelephoneNumber>+390123456789</md:TelephoneNumber>
</md:ContactPerson>
<md:ContactPerson contactType="billing">
<md:Extensions
xmlns:fpa="https://spid.gov.it/invoicing-extensions">
<fpa:CessionarioCommittente>
<fpa:DatiAnagrafici>
<fpa:IdFiscaleIVA>
<fpa:IdPaese>IT</fpa:IdPaese>
<fpa:IdCodice>02468135791</fpa:IdCodice>
</fpa:IdFiscaleIVA>
<fpa:Anagrafica>
<fpa:Denominazione>
Destinatario_Fatturazione
</fpa:Denominazione>
</fpa:Anagrafica>
</fpa:DatiAnagrafici>
<fpa:Sede>
<fpa:Indirizzo>via [...]</fpa:Indirizzo>
<fpa:NumeroCivico>99</fpa:NumeroCivico>
<fpa:CAP>12345</ fpa:CAP>
<fpa:Comune>nome_citta</fpa:Comune>
<fpa:Provincia>XY</fpa:Provincia>
<fpa:Nazione>IT</fpa:Nazione>
</fpa:Sede>
</fpa:CessionarioCommittente>
</md:Extensions>
<md:Company>Destinatario_Fatturazione</md:Company>
<md:EmailAddress>[email protected]</md:EmailAddress>
<md:TelephoneNumber>telefono_fatture</md:TelephoneNumber>
</md:ContactPerson>
</md:EntityDescriptor>
Loading

0 comments on commit da3c05c

Please sign in to comment.