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

Check on missing Assertion element in Response #113

Open
haunted2 opened this issue Jun 30, 2020 · 1 comment
Open

Check on missing Assertion element in Response #113

haunted2 opened this issue Jun 30, 2020 · 1 comment
Labels
bug Something isn't working

Comments

@haunted2
Copy link

Hello.
According to the SPID Quality Assessment Document ( https://www.spid.gov.it/assets/download/SPID_QAD.pdf ), test 3.32,
if the Assertion element is missing, the Service Provider should give an error message.

This lib, perform tests on the assertion:

if ($hasAssertion) {

but it doesn't throw an exception if the element is not present in the response.
In fact, when performing tests with the spid-testenv2 ( https://github.com/italia/spid-testenv2 ), if i check the "Assertion assente" option. i can't login but i don't get any error message.

Looking at the spid-php-lib code, it seems to be legitimate to have no Assertion, so i don't really know which way to go, whether to add the exception or leave the code as it is.
Could you give me some suggestions? Thank you.

@lorenzocattaneo
Copy link
Collaborator

Hi,

there is indeed a bug, and an exception should be thrown. I've checked the technical documentation and the relevant point is:

Deve essere presente un elemento <Assertion> ad attestare l’avvenuta autenticazione, contenente almeno un elemento <AuthnStatement>; nel caso l’Identity Provider abbia riscontrato un errore nella gestione della richiesta di autenticazione l’elemento <Assertion> non deve essere presente.

So we should expect to have an Assertion when the StatusCode is Success and throw an exception if missing, but expect no Assertion if login failed.

@lorenzocattaneo lorenzocattaneo added the bug Something isn't working label Jun 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants