Simplesamlphp落后于负载平衡器时发生故障



我们使用simplesamlphp作为服务提供商。我们已经集成了许多Idp。一切都很好。

现在我们想将服务器体系结构更改为load balancer -> webserver -> database server。当我们把load balancer放在webserver前面时,问题就出现了。idp出现错误。

load balancer终止了https,我认为这就是问题发生的地方。因此,当load balancerwebserver发送请求时,它是常规的http请求。

当我记录最初发生的事情时,我会得到

我将简化xml,并放置不同的零件

load balancer

Session: 'idp-name' not valid because we are not authenticated.
Saved state: '_somelongstringofnumbersandletters'
Sending SAML 2 AuthnRequest to '{{their info}}'
Sending message:
    <samlp:AuthnRequest ... AssertionConsumerServiceURL="http://{{our-info}}">
        <saml:Issuer>http://{{our-info}}</saml:Issuer>
        <samlp:NameIDPolicy Format="urn:oasis:names:tc:SAML:2.0:nameid-format:transient" AllowCreate="true"/>
    </samlp:AuthnRequest>

因此,在指向load balancerwebserver之间唯一不同的部分分别是httphttps

不确定是否有办法让simplesamlphp只返回https。或者它总是检查请求的当前状态并假定http

只是为了确保我提供了所有的数据。进程是由SP初始化的。因此,它们只是转到一个url,如https://oursite.com/idp-name.我们一直在使用https

如果我需要澄清什么,请告诉我。

更新

我们通过NOT终止负载平衡器上的HTTPS请求并允许请求传递到服务器来解决问题。因此,我们的SSL证书直接在我们的Web服务器上,而不是负载均衡器上。

我无法找到解决方案,但那可能是我自己的错。我们需要一个快速的解决方案,而不在负载均衡器上解密SSL是最简单的方法。

James!

我相信您正在使用负载均衡器作为反向代理,因此请确保在phpsimplesaml的config/config.php中设置了正确的变量,尤其要注意baseurlpath

$config = array(
/**
 * Setup the following parameters to match the directory of your installation.
 * See the user manual for more details.
 *
 * Valid format for baseurlpath is:
 * [(http|https)://(hostname|fqdn)[:port]]/[path/to/simplesaml/]
 * (note that it must end with a '/')
 *
 * The full url format is useful if your simpleSAMLphp setup is hosted behind
 * a reverse proxy. In that case you can specify the external url here.
 *
 * Please note that simpleSAMLphp will then redirect all queries to the
 * external url, no matter where you come from (direct access or via the
 * reverse proxy).
 */
'baseurlpath' => 'https://sso.yourcompanyname.com/simplesaml/',
... 

还要确保返回SP的回复返回正确的协议(https)

事实上,如果我的假设是正确的,错误日志将非常感谢

最新更新