dkd / php-cmis-client

This is a PHP CMIS Client implementation based on OpenCMIS. It has been retired and put in to archive mode.
Apache License 2.0
54 stars 34 forks source link

is it to possible to send a custom http header #65

Closed saurav28 closed 2 days ago

saurav28 commented 6 years ago

Hi,

Is it possible to send a custom http header to the requests.

Something like AuthenticationProviders what we have in Java OpenCMIS .

Best Regards, Saurav

sascha-egerer commented 6 years ago

Should be possible. You can define them in the http invoker. See this example https://github.com/dkd/php-cmis-client/blob/master/examples/CreateFolder.php#L9 and the guzzle documentation http://docs.guzzlephp.org/en/5.3/clients.html

saurav28 commented 6 years ago

Thanks Sascha for the reply.

And how can i get hold of the response sent back from the request sent ? such that i can fetch a response header being sent from the server .

Best Regards, Saurav

sascha-egerer commented 6 years ago

I would say that this is not possible. Could you please explain why you would need that?

saurav28 commented 6 years ago

so, i need to connect a CMS server which exposes a csrf token in response header of the first request and then i need to pass this csrf in subsequent calls.

saurav28 commented 6 years ago

OpenCMIS and PortCMIS provides this through their AuthenticationProvider concept which can be plugged as a session parameter.

https://github.com/apache/chemistry-opencmis/blob/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-api/src/main/java/org/apache/chemistry/opencmis/commons/spi/AuthenticationProvider.java

sascha-egerer commented 5 years ago

@saurav28 You can inject the httpInvoker. I think this is what you need?! https://github.com/dkd/php-cmis-client/blob/master/examples/CreateDocument.php#L9