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

GetBindingLocation in Base class is not returning Identity provider's complete URL #50

Closed
giuliogatto opened this issue Oct 4, 2018 · 4 comments

Comments

@giuliogatto
Copy link

I am trying the Docker-compose example from:
https://github.com/simevo/spid-wordpress/tree/master/docker
but I find an issue when clicking the 'Accedi con SPID usando testenv2 come IdP' button.
The issue is that the application is redirecting me to the wrong URL (http://localhost:8099/sso?SAMLRequest=xxx which is the Service Provider url) instead of http://localhost:8088/sso?SAMLRequest=xxx which is the Identity Provider url).
The result is a NOT FOUND error.

After a bit of investigation the problem seems to be in the method GetBindingLocation of Base class:

if ($binding == $val['binding']) $location = $val['location'];

which seems to skip the Identity Provider url when building the redirect, infact if I change that line to:

if ($binding == $val['binding']) $location = $this->idp->metadata["idpEntityId"].$val['location'];

everything works.

BTW: I am not sure if that's the right place to compose the complete url (maybe it should be inside the IDP class itself).

@lorenzocattaneo
Copy link
Collaborator

see italia/spid-testenv2#193

I'll be adding some extra checks on our end to better signal the error, but as a temporary solution you could manually edit the IDP metadata you downloaded.

@simevo
Copy link
Collaborator

simevo commented Oct 7, 2018

if the testenv does not comply to our request, we can probably handle it with something like:

if ($binding == $val['binding']) {
    if ($val['location'][0] == '/') {
        // relative url
        $location = $this->idp->metadata["idpEntityId"].$val['location'];
    } else {
        // absolute url
        $location = $val['location'];
    }
}

@simevo
Copy link
Collaborator

simevo commented Oct 10, 2018

PR italia/spid-testenv2#194 was merged so the problem should be gone

waiting for confirmation ...

@simevo
Copy link
Collaborator

simevo commented Oct 10, 2018

solved; if you are using docker, remember to docker pull italia/spid-testenv2

@simevo simevo closed this as completed Oct 10, 2018
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

3 participants