chemistry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matheus de Oliveira Barreto <>
Subject CMIS Java Class connection to Microsoft SharePoint 2013 - Unauthorized
Date Fri, 08 May 2015 20:17:58 GMT
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) {
            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

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
Comercial  +55 11 5503-6710

foxfly IT & Marketing
Av. Das Nações Unidas, 12995 - 10º andar
CEP 04578-000, Brooklin Novo
São Paulo, SP

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message