Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SPID Quality Assessment] Elemento NameQualifier #20

Open
peppelinux opened this issue May 11, 2021 · 4 comments
Open

[SPID Quality Assessment] Elemento NameQualifier #20

peppelinux opened this issue May 11, 2021 · 4 comments
Assignees

Comments

@peppelinux
Copy link
Member

ERROR:spid_sp_test:Test [48] Attributo NameQualifier di NameID dell'Assertion non specificato. Risultato atteso: KO: : [http status_code: 200] : FAILED
ERROR:spid_sp_test:Test [49] Attributo NameQualifier di NameID dell'Assertion mancante. Risultato atteso: KO: : [http status_code: 200] : FAILED
@peppelinux peppelinux changed the title [SPID Quality Assesment] Elemento NameQualifier [SPID Quality Assessment] Elemento NameQualifier May 11, 2021
@peppelinux
Copy link
Member Author

@francescm @robertogallea
Closed by #27?

@francescm
Copy link
Collaborator

francescm commented Jun 14, 2021

Purtroppo no.
#27 Risolve Request check strict: Test the compliance of Issuer element
[2] The Issuer's value must be equal to entityID - TR pag. 9

@francescm
Copy link
Collaborator

Qui siamo sempre nel reame di italia/spid-regole-tecniche#15

@ziobob94
Copy link

ziobob94 commented Mar 20, 2024

Salve a tutti,

Volevo condividere una soluzione al problema che ho risolto, il quale è dettagliatamente spiegato nella documentazione ufficiale delle Regole Tecniche.

Contrariamente a quanto indicato nella documentazione, per garantire che il campo "NameQualifier" venga accettato, è necessario aggiungere l'elemento <saml:Subject>

Ecco il template che ho elaborato:

<samlp:AuthnRequest xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol" ID="{ID}" Version="2.0" IssueInstant="{IssueInstant}" Destination="{Destination}" AssertionConsumerServiceURL="{AssertionConsumerServiceURL}" ProtocolBinding="{ProtocolBinding}" AttributeConsumingServiceIndex="{AttributeConsumingServiceIndex}" ForceAuthn="{ForceAuthn}"> <saml:Issuer xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion" Format="urn:oasis:names:tc:SAML:2.0:nameid-format:entity" NameQualifier="{NameQualifier}">{NameQualifier}</saml:Issuer> <saml:Subject xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion" > <saml:NameID Format="urn:oasis:names:tc:SAML:2.0:nameid-format:unspecified" NameQualifier="{NameQualifier}">{NameQualifier}</saml:NameID> <saml:Conditions NotBefore="{NotBefore}" NotOnOrAfter="{NotOnOrAfter}"/> </saml:Subject> <samlp:NameIDPolicy Format="urn:oasis:names:tc:SAML:2.0:nameid-format:transient" SPNameQualifier="{NameQualifier}" /> <samlp:RequestedAuthnContext Comparison="{Comparison}"> <saml:AuthnContextClassRef xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion" >https://www.spid.gov.it/SpidL{Level}</saml:AuthnContextClassRef> </samlp:RequestedAuthnContext> </samlp:AuthnRequest>

Fate attenzione alla generazione dell'ID. Vi fornisco anche la funzione per generarlo:
export function generateAuthnRequestId() { const validStartChars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_'; const validChars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_'; let generatedString = validStartChars.charAt(Math.floor(Math.random() * validStartChars.length)); const remainingLength = 42 - 1; for (let i = 0; i < remainingLength; i++) { generatedString += validChars.charAt(Math.floor(Math.random() * validChars.length)); } return generatedString; }

Ricordatevi di firmare questo documento nel caso del BINDING: Post.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants