【问题标题】:Failure when Simplesamlphp is behind load balancerSimplesamlphp 在负载均衡器后面时失败
【发布时间】:2016-04-01 04:58:09
【问题描述】:

我们使用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 初始化。所以他们只是去一个像https://oursite.com/idp-name这样的网址。而且我们一直使用https

如果我需要澄清一些事情,请告诉我。

更新

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

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

【问题讨论】:

  • 您的问题解决了吗?我面临着类似的问题,如果您可以更新适合您的解决方案,那就太好了。谢谢!!
  • @wanjarisushil 我更新了这个问题。不知道它是否会有所帮助。

标签: php https load-balancing saml-2.0 simplesamlphp


【解决方案1】:

詹姆斯!

我相信您正在使用负载均衡器作为反向代理,因此请确保在 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)

事实上,如果我的假设是正确的,错误日志将不胜感激

【讨论】:

    猜你喜欢
    • 2019-03-03
    • 1970-01-01
    • 1970-01-01
    • 2018-04-14
    • 2013-10-12
    • 1970-01-01
    • 1970-01-01
    • 2021-12-07
    • 1970-01-01
    相关资源
    最近更新 更多