They have two ways to do this. You can use one of them using the SharePoint / Add-In application model, and the other using network authentication with Windows credentials. Given this question, I assume the latter will be simpler and better match the setup.
This will create Windows authentication credentials that you can use for your HTTP requests.
RequestConfig reqConfig = RequestConfig.custom().setTargetPreferredAuthScemes(Arrays.asList(AuthSchemes.NTLM)).setProxyPreferredAuthSchemes(Arrays.asList(AuthSchemes.BASIC)).build(); CredentialsProvider credProvider = new BasicCredentialsProvider(); credProvider.setCredentials(AuthSocpe.ANY, new NTCredentials("user", "pass", "currentHost", "domainName")); HttpClient client = HttpClients.custom().setDefaultCredentialsProvider(credProvider).setDefaultRequestConfig(reqConfig).build();
source share