Above script inserts U1 to Users section in QMC. So that's why I don't think it may not be a certificate issue. My script also returns response pointing to Qlik resources like: http://reverseProxy/resources/assets/hub/hub.css, thus returning error (below screenshot). While hub.css exists in http://QlikServer/resources/assets/hub/hub.css. That's why I thought returning html content only (getbody() in above script) isn't correct.
Does it have something to do with your reverse proxy? The request address for the css file, is that ip of the Sense server?
In addition, I'd look at your getBody function. I don't think you want to do that. You want to get the whole response so you need to reference it from the httprequest class in php instead of httpmessage.
Thanks Jeff! Very informative code. I see one button to request for ticket (with header), and another button to redirect with a sole URL parameter (no headers). I am looking for SSO with header authentication. So do I use your code as:
I think instead of redirecting to the hub, you output the response to the browser. You are already creating a request to the hub with the headers, therefore, you should get a response letting you in. I'll have to play around with it to give you an updated sample. You have to make sure to include the certificate in the request.
If you are getting null response on the certificate it means that the certificate lookup in the code is not finding the specified certificate to include in the request in your cert store.
I have my QlikClient cert in the personal folder of the local machine store. You may not have the cert imported which is something you will want to do. If you do, maybe it is in personal folder of current user store. If that is the case you will want to change the reference in the cert lookup to point to Storename.CurrentUser.