SharePoint OAuth Authentication | Authorizing REST API SharePoint| Get Access token from SharePoint | Set up OAuth for SharePoint | SharePoint Integration | Rest API Integration

Step 1: Join the Microsoft 365 Developer Program

  1. Go to the Join the Microsoft 365 Developer Program page.
  2. Click on Join now and complete the Signup process.
Microsoft 365 Developer Program

Step 2: Register an app in SharePoint

a. Navigate to https://<domain_name.sharepoint.com>/layouts/15/appregnew.aspx (For ex: https://sp0l.sharepoint.com/_layouts/15/appregnew.aspx)

Step 3: Get the Realm of your site using PostMan.

  1. Open PostMan App (Get it from here)
  2. Create a GET request with url https://<domain_Name>.sharepoint.com/_vti_bin/client.svc
  3. Headers, ‘Authorization’ : ‘Bearer’ & ‘Content-Type’ : ‘text/html’
  4. Send Request and click on Header section in response and scroll down till you see Bearer realm. (screenshot attached below)

Step 4: Get the Authorization code

  1. Construct the below url using your domain, client Id, and redirect uri and scope value from the following link.

Step 5: Get the access token and refresh token

  1. Construct the below url and body for POST request in POSTMAN

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store