How to obtain an access token for On-premises SharePoint

Shankar, Bhukya 0 Reputation points
2024-05-28T12:03:30.0066667+00:00

I have a SharePoint clientId and clientSecret. Is it possible to obtain an access token for On-premises SharePoint through a Windows service?

what should be the API end point to get the access token?

SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
11,229 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. RaytheonXie_MSFT 40,451 Reputation points Microsoft External Staff
    2024-05-29T07:15:58.5566667+00:00

    Hi @Shankar, Bhukya,

    SharePoint Server is different with SharePoint Online, there is no tenant id for a SharePoint Server site. We are unable to get access token as SharePoint Online.

    As a workaround, we could use NTLM Authothorization to access SharePoint Rest api. You could refer to the steps in following issue similar with yours

    https://sharepoint.stackexchange.com/questions/284483/token-based-authentication-in-sharepoint-2016


    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.