How to read the sharepoint with the help of java. And I only have username and password of the sharepoint. Is there any way to access sharepoint with the help of username and password.

Afzal Ghani 0 Reputation points
2024-04-15T12:57:13.1566667+00:00

Hi, I want to read file from the SharePoint but I have only a username and password. Is there any way to access SharePoint with the help of a username/password? I do not have clientId, secretKey, and tenantId. Also if any way exist so that I hit the API and then get the token and use that token to access sharepoint. Please reply asap.

Microsoft 365 and Office | SharePoint | Development
Microsoft 365 and Office | SharePoint | For business | Windows
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. RaytheonXie_MSFT 40,471 Reputation points Microsoft External Staff
    2024-04-16T02:38:00.78+00:00

    Hi @Afzal Ghani,

    Since our forum focus on C#, I am not familar with java. After doing some research, there seems no such function to connect sharepoint with rest api using username/password. You will need to register sharepoint app only. Here is a similar issue with yours, the answer need to use clientId and secret.

    https://sharepoint.stackexchange.com/questions/280852/how-to-authenticate-a-java-job-at-sharepoint-online

    If you could use C#, I would recommend you to use CSOM. By using CSOM, we could connect sharepoint with username/password directly. You could refer to following article

    https://www.c-sharpcorner.com/blogs/office365-how-to-connect-sharepoint-online-site-using-csom


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.