[
https://issues.apache.org/jira/browse/CMIS-736?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13832753#comment-13832753
]
Florian Müller commented on CMIS-736:
-------------------------------------
You are looking for an authentication provider.
- Create a class that extends the {{StandardAuthenticationProvider}} class.
- Override the method {{getHTTPHeaders()}}. Return the headers from
{{super.getHTTPHeaders()}} and add your custom header.
- Add a session parameter for the authentication provider when you create a
session ({{SessionParameter.AUTHENTICATION_PROVIDER_CLASS}}).
Here are a few links:
https://chemistry.apache.org/java/developing/client/dev-client-bindings.html
https://chemistry.apache.org/java/0.10.0/maven/apidocs/org/apache/chemistry/opencmis/commons/spi/AuthenticationProvider.html
https://chemistry.apache.org/java/0.10.0/maven/apidocs/org/apache/chemistry/opencmis/commons/SessionParameter.html
https://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/StandardAuthenticationProvider.java?view=markup
> Need to add custom HTTP request properties
> ------------------------------------------
>
> Key: CMIS-736
> URL: https://issues.apache.org/jira/browse/CMIS-736
> Project: Chemistry
> Issue Type: Wish
> Components: opencmis-client-bindings
> Affects Versions: OpenCMIS 0.10.0
> Reporter: Derrick Brooks
> Priority: Minor
> Fix For: OpenCMIS 1.0.0
>
>
> I'm using the OpenCMIS client to connect to a Sharepoint document library
> that have some custom authorization code on the server side. That custom code
> requires that additional HTTP request properties be sent from the client.
> My current working workaround, is that I've defined my own HttpInvoker that
> is basically a copy of the DefaultHttpInvoker
> (org.apache.chemistry.opencmis.client.bindings.spi.http.DefaultHttpInvoker)
> with the addition of two conn.setRequestProperty(...) statements in the
> invoke method.
> It would be nice if I didn't have to duplicate code. A protected method like
> below that I could override for a custom invoker would be ideal ...
> protected void initConnection(HttpURLConnection conn, BindingSession session)
> {
> ...
> }
--
This message was sent by Atlassian JIRA
(v6.1#6144)