2015-12-26 30 views
1

我们使用simplesamlphp作为服务提供者。我们已经整合了一些Idp的。一切正常。Simplesamlphp在负载平衡器后面失败

现在我们要将我们的服务器架构更改为load balancer -> webserver -> database server。当我们将load balancer放在webserver的前面时,问题就出现了。这个idp出错了。

load balancer终止https,我相信这是问题发生的地方。所以当load balancer发送请求到webserver这是一个正规的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

让我知道我是否需要澄清一些事情。

UPDATE

我们通过NOT解决了这个问题终止于负载平衡器的HTTPS请求,并允许该请求通过传递给服务器。所以我们的SSL证书直接在我们的Web服务器上,而不是负载均衡器上。

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

+0

你的问题解决了吗?我面临类似的问题,如果您能更新为您工作的解决方案,那将是非常好的。谢谢!! – wanjarisushil

+0

@wanjarisushil我对问题进行了更新。不知道它是否会帮助。 – James

回答

2

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)

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