We use simplesamlphp as a service provider. We've integrated with a number of Idp's. Everything works fine.
Now we want to change our server architecture to load balancer -> webserver -> database server
. The problem comes up when we put the load balancer
in front of the webserver
. The idp's get an error.
The load balancer
terminates https
, which I believe is where the problem is happening. So when the load balancer
sends the request to the webserver
it is a regular http
request.
When I log the initial happenings I get
I'm gonna simplify the xml
a bit and put the parts that were different
with 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>
So above the only parts that are different between pointing to load balancer
and webserver
is the http
and https
, respectively.
Wasn't sure if there was a way to have simplesamlphp
just return https
. Or will it always check the current state of the request and assume http
.
Just to make sure I'm giving all the data. The process is initialized by the SP. So they just go to a url like https://oursite.com/idp-name. And we are always using https
.
Let me know if I need to clarify something.
UPDATE
We solved the problem by NOT terminating the HTTPS request at the load balancer, and allowing the request to pass through to the servers. So our SSL certificates are directly on our Web servers and not the load balancer.
I couldn't get the solution given to work, but that could just be my own fault. We needed a solution quick, and not decrypting SSL on the load balancer was the easiest way.