Connecting via CMIS (dotCMIS) to SP2010: exception unauthorised

余生颓废 提交于 2019-12-02 21:26:09

问题


Im using dotCMIS and would like to do a simple connect to my SP2010 server. Im trying to do this with C# like here http://chemistry.apache.org/dotnet/getting-started-with-dotcmis.html in the first part

So I have something like this:

    Dictionary<string, string> parameters = new Dictionary<string, string>();
    parameters[SessionParameter.BindingType] = BindingType.AtomPub;
    parameters[SessionParameter.AtomPubUrl] = "http://mysharepoint";
    parameters[SessionParameter.User] = "SPAdmin";
    parameters[SessionParameter.Password] = "1234sharepoint";

    SessionFactory factory = SessionFactory.NewInstance();
    ISession session = factory.GetRepositories(parameters)[0].CreateSession(); //exception unathorized

But I get always the exception: DotCMIS.Expcetions.CmisRunterimException: Unathorised

Any ideas? Via browser I can login to the site with the same user/pass, so thats might be not the problem. At first I tought its because of the NTLM problem (https://issues.apache.org/jira/browse/CMIS-531) but even if Im using parameters[SessionParameter.AuthenticationProviderClass] = "DotCMIS.Binding.NtlmAuthenticationProvider"; its the same exception. And well... this exception is not really helping me. I wish I could get more information - maybe there is a better way? What else could I try? Thank you!

PS: And yes, before I started with dotCMIS I did install and configure the MS CMIS connector: http://technet.microsoft.com/en-us/library/ff934619.aspx


回答1:


Your AtomPubUrl looks suspicious. I can't tell if that's a placeholder you've added to mask the real URL or if that's the actual URL you are using. If it is the actual URL it looks like it is missing the path to the AtomPub service document. To tell if that's the case, you should be able to invoke the URL, log in, and get a bunch of XML back, which is the CMIS service descriptor. If instead you are getting a user-facing page full of HTML, you are using the wrong URL.

For example, in Alfresco, users log in to /share, but the AtomPub binding is at /alfresco/cmisatom.




回答2:


Yes the AtomPubUrl was wrong.

For sharepoint its not enough to post the default sp url (http://mysharepoint) or the url to the cmis lib (http://mysharepoint/cmis) I need to point to the repository id, somehow the sp endpoint for CMIS is:

http://mysharepoint/_vti_bin/<myLib4CMIS>/<repID>?getRepositoryInfo

http://technet.microsoft.com/en-us/library/ff934619.aspx

Somehow it was confusing, but its working :) dotCMIS is really nice.



来源:https://stackoverflow.com/questions/10941809/connecting-via-cmis-dotcmis-to-sp2010-exception-unauthorised

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!