CmisUnauthorizedException – 连接到 SharePoint

huangapple go评论108阅读模式
英文:

CmisUnauthorizedException - connecting to sharepoint

问题

我正在使用CMIS与SharePoint连接。在尝试在SharePoint中创建会话时,出现了未经授权的异常,因此无法将文档上传到SharePoint。我正在使用NTLM身份验证与SharePoint进行连接,但它未能对用户进行身份验证。我正在使用CMIS中默认的NTLM实现 CmisBindingFactory.NTLM_AUTHENTICATION_PROVIDER _ 它是否支持NTLM身份验证?如果不支持,如何在CMIS中实现NTLM身份验证?

以下是我尝试过的代码:

SessionFactory sessionFactory = SessionFactoryImpl.newInstance();
Map<String, String> parameter = new HashMap<>();
parameter.put(SessionParameter.ATOMPUB_URL, url);

parameter.put(SessionParameter.BINDING_TYPE, BindingType.ATOMPUB.value());
// 激活OpenCMIS NTLM身份验证提供程序。
parameter.put(SessionParameter.AUTHENTICATION_PROVIDER_CLASS, CmisBindingFactory.NTLM_AUTHENTICATION_PROVIDER);
// 会话区域设置。
parameter.put(SessionParameter.LOCALE_ISO3166_COUNTRY, "");
parameter.put(SessionParameter.LOCALE_ISO639_LANGUAGE, "en");
parameter.put(SessionParameter.LOCALE_VARIANT, "US");
parameter.put(SessionParameter.USER, userName);
parameter.put(SessionParameter.PASSWORD, password);

Session session = sessionFactory.createSession();
英文:

I am using CMIS to connect with SharePoint. I am getting Unauthorized exception while creating session in SharePoint, So I couldn't upload the document in SharePoint. I am using NTML authentication to connect with SharePoint, but it's not authenticating the user, I am using default NTML implantation from CMIS CmisBindingFactory.NTLM_AUTHENTICATION_PROVIDER _ is it supporting NTLM authentication? if not how to implement NTML authentication in CMIS?

Please find the below code which I have tried.

SessionFactory sessionFactory = SessionFactoryImpl.newInstance();
	Map&lt;String, String&gt; parameter = new HashMap&lt;&gt;();
	parameter.put(SessionParameter.ATOMPUB_URL,
		url);
	
	parameter.put(SessionParameter.BINDING_TYPE, BindingType.ATOMPUB.value());
	// activate the OpenCMIS NTLM authentication provider.
	parameter.put(SessionParameter.AUTHENTICATION_PROVIDER_CLASS,
		CmisBindingFactory.NTLM_AUTHENTICATION_PROVIDER);
	// Session locale.
	parameter.put(SessionParameter.LOCALE_ISO3166_COUNTRY, &quot;&quot;);
	parameter.put(SessionParameter.LOCALE_ISO639_LANGUAGE, &quot;en&quot;);
	parameter.put(SessionParameter.LOCALE_VARIANT, &quot;US&quot;);
	parameter.put(SessionParameter.USER, userName);
	parameter.put(SessionParameter.PASSWORD, password);

Session session = sessionFactory.createSession();

答案1

得分: 0

OpenCMIS没有可靠的NTLM支持。不要使用它!

请参阅 https://svn.apache.org/repos/asf/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/NTLMAuthenticationProvider.java

英文:

OpenCMIS has no reliable NTLM support. Do not use it!

See https://svn.apache.org/repos/asf/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/NTLMAuthenticationProvider.java

huangapple
  • 本文由 发表于 2020年9月25日 20:20:13
  • 转载请务必保留本文链接:https://go.coder-hub.com/64064036.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定