java - CmisUnauthorizedException: Unauthorized - error using Apache Chemistry library interfacing to Sharepoint 2013 -
I'm using Apache Chemistry Library is worried when he joined SharePoint 2013 through CMIS.
I'm getting unauthorized error , but I used credentials (U / P) are correct.
I used it to log in to SharePoint online, so it should work on my code.
Hope someone can help me solve this. Thanks!
See below my code I'm using to make the session in Sharepoint:
public session fillParams () {// connection to define a value for the string Rest_base = "http: //" server> "/ sites / _api / web /"; String repository_id = "C 1013 B 776-4821-48 9F-9A1C-1D 43 BFC1C32"; String atompub_url = rest_base + "/" + repository_id + ""; String Username = "Notaub Shona"; String password = "notTobeShown"; Session Factory Factory = SessionFinal IMPL.Newinstance (); Maps & lt; String, string & gt; Parameter = new hashmap & lt; String, string & gt; (); Parameter.Put (session Parameter.ATOMPUB_URL, rest_base); Parameter.Put (SessionPalmator.BINDING_TYPE, BindingType.atpm.value ()); Parameter.Put (session Parameter.AUTH_HTTP_BASIC, "true"); Parameter.put (session Parameter.USER, user name); Parameter.Put (session Parameter.PASSWORD, password); Println ("Pfft"); & Lt; Stores & gt; Repository = factory. Gatepositions (parameters); System.out.println ("Repositories:" + Repositories. ()); Return repositories (0) .create session (); } For the full exception Staktrres, please see below:
exception in thread "main" org.apache.chemistry.opencmis.commons .exceptions.CmisUnauthorizedException: Unauthorized org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.convertStatusCode (AbstractAtomPubService.java:466) at org.apmache.chemistry.opencmis.client.bindings. Spi.atompub.AbstractAtomPubService.read (AbstractAtomPubService.java:619) at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.getRepositoriesInternal (AbstractAtomPubService.java:782) at org.apache.chemistry.opencmis. On the Client.bindings.spi.atim.ubp.repi.etc.at.api.atompub.RepositoryServiceImpl.getRepositoryInfos (org.apache.chemistry) org.apache.chemistry.opencmis.client.bindings.impl.RepositoryServiceImpl.getRepositoryInfos (Repository service at IPL.Java: 88) (Repository service imp Kjwa: 65) Opencmis.client.runtime.SessionFactoryImpl.getRepositories (SessionFactoryImpl.java:133) sample.CMISConnect.main on Sample.CMISConnect.fillParams (CMISConnect.java35) on org.apach (CMISConnect.java 42) e sample Kkemistrykopenkmiskclaintkruntimeksessionfktoryimplkgetrepositoris (Sessionfktoryimplkjawa:lll)
< P> Click the gear icon at the top right of your site page. Site Site Settings - & gt; Manage Site Features under Site Actions This should be active in 'CMIS Producer'.
Comments
Post a Comment