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

Invalid Response - SAML ACS response doesn't work for default Bitnami Wordpress image when Apache runs on TCP/8080 #113

Open
dlew56 opened this issue Feb 16, 2021 · 1 comment

Comments

@dlew56
Copy link

dlew56 commented Feb 16, 2021

Hi,

The default non-privileged Bitnami Wordpress container has Apache/container run on TCP/8080 (https://github.com/Bitnami/bitnami-docker-wordpress).

When it is configured this way, we reach this SAML error on login attempts after successful auth against our IDP:

The response was received at https://test.domain.net:8080/wp-login.php instead of https://test.domain.net/wp-login.php?saml_acs
There was at least one error processing the SAML Response: invalid_response
Contact the administrator

Here's part of the SAML response:
<samlp:Response ID="_68a3d2a1-d014-4720-b08d-d32c86badddf" Version="2.0" IssueInstant="2021-02-16T21:03:40.534Z" Destination="https://test.domain.net/wp-login.php?saml_acs" Consent="urn:oasis:names:tc:SAML:2.0:consent:unspecified" InResponseTo="ONELOGIN_35e46bf2427411ed77f96e3f4d6d92aec6c6e466" xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol"> <Subject> <NameID>USERNAME/NameID> <SubjectConfirmation Method="urn:oasis:names:tc:SAML:2.0:cm:bearer"> <SubjectConfirmationData InResponseTo="ONELOGIN_35e46bf2427411ed77f96e3f4d6d92aec6c6e466" NotOnOrAfter="2021-02-16T21:08:40.534Z" Recipient="https://test.domain.net/wp-login.php?saml_acs" /> </SubjectConfirmation> </Subject>

However if we ran the container as Privileged (root) and change the Bitnami Dockerfile to:
APACHE_HTTPS_PORT_NUMBER="443"
APACHE_HTTP_PORT_NUMBER="80" \

Then it works.

However, we can't adjust the APACHE port numbers while the container is unprivileged, which is best practice.

How should we proceed?

Thanks,
David

@pitbulk
Copy link
Contributor

pitbulk commented Feb 22, 2021

Edit the settings.php

and after

https://github.com/onelogin/wordpress-saml/blob/master/onelogin-saml-sso/php/settings.php#L10
``

add:

use OneLogin\Saml2\Utils;

Utils::setBaseURL("https://test.domain.net/");


I will consider adding this as a new setting in a future release of the plugin.

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

2 participants