diff --git a/config/saml2.php b/config/saml2.php index fae987d..85a4031 100644 --- a/config/saml2.php +++ b/config/saml2.php @@ -137,6 +137,18 @@ 'proxyVars' => false, + /* + |-------------------------------------------------------------------------- + | Whether to force the server self port + |-------------------------------------------------------------------------- + | + | If 'serverPort' is setted will get this one - Good in case your Laravel + | application is behind a docker container using another port. + | + */ + + 'serverPort' => env('APP_PORT'), + /* |-------------------------------------------------------------------------- | Service Provider configuration. diff --git a/src/Http/Controllers/Saml2Controller.php b/src/Http/Controllers/Saml2Controller.php index 61e913b..bc21a30 100644 --- a/src/Http/Controllers/Saml2Controller.php +++ b/src/Http/Controllers/Saml2Controller.php @@ -46,7 +46,6 @@ public function metadata(Auth $auth) public function acs(Auth $auth) { $errors = $auth->acs(); - if (!empty($errors)) { $error = $auth->getLastErrorReason(); $uuid = $auth->getTenant()->uuid; diff --git a/src/OneLoginBuilder.php b/src/OneLoginBuilder.php index 4e1adf5..76dcd21 100644 --- a/src/OneLoginBuilder.php +++ b/src/OneLoginBuilder.php @@ -65,6 +65,10 @@ public function bootstrap() OneLoginUtils::setProxyVars(true); } + if ($this->app['config']->get('saml2.serverPort')) { + OneLoginUtils::setSelfPort($this->app['config']->get('saml2.serverPort')); + } + $this->app->singleton('OneLogin_Saml2_Auth', function ($app) { $config = $app['config']['saml2'];