chemistry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Florian Müller <f...@apache.org>
Subject Re: CMIS Java Class connection to Microsoft SharePoint 2013 - Unauthorized
Date Sun, 10 May 2015 07:22:46 GMT
Hi Matheus,

If you can connect with the CMIS Workbench, try the following.

* Connect with the CMIS Workbench.
* Return to the Login dialog and select the Expert tab. Here you should 
find the session parameters that were used for this connection.
* Take these session parameters and use them in your Java program.
* If that works, play with the parameters. You probably don't need all 
of them for a successful connection.
* If that doesn't work, check if you need additional proxy settings. The 
CMIS Workbench tries to figure them automatically, but your program doesn't.


When everything works fine, also add the following session parameters:

org.apache.chemistry.opencmis.workaround.omitChangeTokens=true
org.apache.chemistry.opencmis.workaround.addNameOnCheckIn=true

They enable workarounds for bugs in the SharePoint CMIS connector.



- Florian


> Hello guys.
>
>
> Again I send you a message to get some help developing with Apache Chemistry.
>
>
> So, I got this project where I try to connect to a SharePoint 2013 server using CMIS
and to get/"upload" files there.
>
>
> After the help of Sascha Homeier here on this list, I solved some problems and my project
now works with the public Alfresco CMIS services and a instance of Alfresco I have on my environment.
However, when I try to use it on SharePoint 2013, I got some problems.
>
>
> So, my code for connection is:
>
>
> Session session = CMISServicesImpl.connect(strHost, strUser, strPassword);
>
> Folder root = session.getRootFolder();
>          ItemIterable<CmisObject> children = root.getChildren();
>          System.out.println("Found the following objects in the root folder:-");
>          ArrayList documentsArray = new ArrayList();
>          for (CmisObject o : children) {
>          documentsArray.add(o);
>              System.out.println(o.getName() + " which is of type " + o.getType().getDisplayName());
>          }
>
> Basically, the code we all can get on the getting started examples on the Chemistry webpage.
> When trying to connect to a SharePoint 2013 that have the CMIS enabled, as well as basic
authentication (I can, for example, connect to this repository via CMISSync - a CMIS open
source client - or Apache Chemistry CMIS Workbench without problems, so the issue are not
the credentials or the url), I get the following exception:
>
> org.apache.chemistry.opencmis.commons.exceptions.CmisUnauthorizedException: Unauthorized
>
> I think that this is something in the communication of my application with the SharePoint
server... This is a common problem for people that try to connect to SharePoint using CMIS
on webpages, but there are not answers on theses pages...
>
> Another important information: I do this connection using https and the server does have
a valid certificate.
>
> Also, if I try the same connection inserting a proposital error on the url (like a letter
where it should be not), the error changes, what tells me that if I get this "Unauthorized"
error, my application are communicating with the SharePoint and the credentials/url data are
correct.
>
> Anyone here know how can I solve this, or at least understand this problem better? Any
tip or hint?
>
> Thanks all you guys again,
>
>
> Matheus Barreto
> eMail          matheus@foxfly.com.br<mailto:jean@foxfly.com.br>?
> Comercial  +55 11 5503-6710
> WebSite     http://www.foxfly.com.br<http://www.foxfly.com.br/>
>
> foxfly IT & Marketing
> Av. Das Nações Unidas, 12995 - 10º andar
> CEP 04578-000, Brooklin Novo
> São Paulo, SP
>

Mime
View raw message