php-cmis-client icon indicating copy to clipboard operation
php-cmis-client copied to clipboard

is it to possible to send a custom http header

Open saurav28 opened this issue 7 years ago • 6 comments

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

saurav28 avatar Mar 24 '18 02:03 saurav28

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

sascha-egerer avatar Mar 25 '18 12:03 sascha-egerer

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

saurav28 avatar Apr 03 '18 15:04 saurav28

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

sascha-egerer avatar Apr 03 '18 15:04 sascha-egerer

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 avatar Apr 03 '18 15:04 saurav28

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

saurav28 avatar Apr 03 '18 15:04 saurav28

@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

sascha-egerer avatar Jan 13 '19 14:01 sascha-egerer