I am working on SharePoint API, and i have a login method which looks like that :
public void login(String configFileName) {
CredentialsProvider credsProvider = new BasicCredentialsProvider();
credsProvider.setCredentials(
new AuthScope(AuthScope.ANY),
new NTCredentials(loginauthent, password, "workstation", urlsite));
client = HttpClients.custom()
.setDefaultCredentialsProvider(credsProvider)
.build();
try {
HttpGet httpget = new HttpGet(urlsite);
System.out.println("Executing request " + httpget.getRequestLine());
HttpResponse response = client.execute(httpget);
try {
System.out.println("----------------------------------------");
System.out.println(response.getStatusLine());
EntityUtils.consume(response.getEntity());
} catch (IOException e) {
logger.error("", e);
}
} catch (IOException e) {
logger.error("", e);
}
}
As I am a beginner, and I must admit I found it on internet, it works perfectly.
The problem is that I don't have any ideas how to disconnect Sharepoint based on my login code.
Can someone help me?
Thank you!!