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.

SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
9,664 questions
SharePoint Development
SharePoint Development
SharePoint: A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.Development: The process of researching, productizing, and refining new or existing technologies.
2,673 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. RaytheonXie_MSFT 31,376 Reputation points Microsoft Vendor
    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.