yii2-saml icon indicating copy to clipboard operation
yii2-saml copied to clipboard

The response was received at http://<appname>.azurewebsites.net/saml/acs instead of https://<appname>.azurewebsites.net/saml/acs

Open seshendramln opened this issue 3 years ago • 2 comments

I have a PHP Yii2 application set up at Azure Web App Service Linux at URL https://.azurewebsites.net/saml/acs

I am using Azure SAML SSO, configured according to the docs, I am getting an invalid response after successful MFA authentication step. When I debug I go the following error The response was received at http://.azurewebsites.net/saml/acs instead of https://.azurewebsites.net/saml/acs

Please help me to solve the issue, it is stopping the business.

seshendramln avatar Oct 22 '21 13:10 seshendramln

I have run into the same issue, this is possibly because your Yii2 app is behind a proxy or load balancer.

If this is the case, in your controller declare:

use OneLogin\Saml2\Utils;

class MySamlController extends Controller {

    public function actions() {

        Utils::setProxyVars(true);
        ...

You can find a guide about this topic on the onelogin/php-saml repository https://github.com/onelogin/php-saml#url-guessing-methods

motzy avatar Jan 24 '22 12:01 motzy

@motzy Thanks, you solved a big problem for us!

ilbassa avatar Nov 22 '23 15:11 ilbassa

@motzy Thank you. It solved the issue. Hence, I am closing the request.

seshendramln avatar Aug 08 '24 07:08 seshendramln