SharePoint onprem Rest API calls From Java Application -


getting unauthorized exception, while trying access sharepoint rest apis post requests java web application.as per msdn, formdigest mandatory post requests.how consume sharepoint rest apis non-microsoft applications?

i recommend reading post post sharepoint 2013 java. credentials, have used ntlm (windows) authentication so:

registry<authschemeprovider> authschemeregistry = registrybuilder.<authschemeprovider>create()         .register(authschemes.ntlm, new jcifsntlmschemefactory())         .register(authschemes.basic, new basicschemefactory())         .register(authschemes.digest, new digestschemefactory())         .register(authschemes.spnego, new spnegoschemefactory())         .register(authschemes.kerberos, new kerberosschemefactory())         .build(); closeablehttpclient httpclient = httpclients.custom()         .setdefaultauthschemeregistry(authschemeregistry)         .build();  ntcredentials creds = new ntcredentials(user, password, workstation, domain); credentialsprovider credsprovider = new basiccredentialsprovider(); credsprovider.setcredentials(authscope.any, creds); httpclientcontext context = httpclientcontext.create(); context.setcredentialsprovider(credsprovider); 

Comments

Popular posts from this blog

networking - Vagrant-provisioned VirtualBox VM is not reachable from Ubuntu host -

c# - ASP.NET Core - There is already an object named 'AspNetRoles' in the database -

ruby on rails - ArgumentError: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true -