0

I'm building a Java application to extract files from Sharepoint using Sharepoint's REST api. First I need to authenticate, our organisation uses OKTA to obtain a token.

The example code I'm using is:

CredentialsProvider credsProvider = new BasicCredentialsProvider();
     credsProvider.setCredentials(AuthScope.ANY,
        new NTCredentials(user, pwd, "", ""));

HttpHost target = new HttpHost("organisation.sharepoint.com", 80, "http");

     HttpClientContext context = HttpClientContext.create();
     context.setCredentialsProvider(credsProvider);

     // The authentication is NTLM.
     // To trigger it, we send a minimal http request
     HttpHead request1 = new HttpHead("/");
     CloseableHttpResponse response1 = null;
     try {
       response1 = httpclient.execute(target, request1, context);
       EntityUtils.consume(response1.getEntity());
       System.out.println("1 : " + response1.getStatusLine().getStatusCode());

I need to modify the NTLM code to use Okta instead to make the call to Sharepoint with context set.

Any help appreciated!

1

1 Answer 1

0

Unfortunately, this is not achievable at the moment. This feature has been requested and will be reviewed by engineering. However, it is not actively being worked on as of right now.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.