Tenant ID not found. Sharepoint API - Postman - Authnetication Token

Anonymous
2021-10-08T12:55:15.627+00:00

Hello Folks,

I am registering an app on SharePoint to make List accessible to external form. App registration has been done and currently working on getting:

  1. Tenant ID
  2. Access Token

I am getting the tenant ID but when using it in postman for getting access token. Gives this error:

{
"error": "invalid_request",
"error_description": "AADSTS90002: Tenant 'xxxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx' not found. Check to make sure you have the correct tenant ID and are signing into the correct cloud. Check with your subscription administrator, this may happen if there are no active subscriptions for the tenant.\r\nTrace ID: d6542975-b71f-4d59-bdb3-0a4162959400\r\nCorrelation ID: 9b3bdd83-672c-413f-b0fa-ffb044c6f633\r\nTimestamp: 2021-10-08 12:46:17Z",
"error_codes": [
90002
],
"timestamp": "2021-10-08 12:46:17Z",
"trace_id": "d6542975-b71f-4d59-bdb3-0a4162959400",
"correlation_id": "9b3bdd83-672c-413f-b0fa-ffb044c6f633",
"error_uri": "https://accounts.accesscontrol.windows.net/error?code=90002"
}

Thanks in advance.

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,664 questions
{count} votes

2 answers

Sort by: Most helpful
  1. RaytheonXie_MSFT 30,996 Reputation points Microsoft Vendor
    2021-10-11T01:59:39.78+00:00

    Hi anonymous user ,
    First we should confirm the permission to the list in the following link

    https://YourSharePointOnlineSiteUrl/_layouts/15/appinv.aspx  
    

    139273-image.png

    <AppPermissionRequests AllowAppOnlyPolicy="true">  
      <AppPermissionRequest Scope="http://sharepoint/content/sitecollection/web" Right="FullControl" />  
    </AppPermissionRequests>  
    

    Then create and click trust it
    139294-image.png
    Please check the steps in following link in register app
    https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/security-apponly-azureacs

    We can get Tenant ID in following url

    https://YourSPOSiteURL/_vti_bin/client.svc/  
    

    139167-image.png

    The id marked with blue is Tenant ID in the picture.


    If an Answer is helpful, please click "Accept Answer" and upvote it.
    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.

    0 comments No comments

  2. Anonymous
    2021-10-12T05:16:01.557+00:00

    Thanks @RaytheonXie_MSFT for your reply.
    I've tried all above mentioned steps. But when I calling api for access Token it gives the error of wrong tenant ID or Tenant not found.

    I am using SharePoint On-Premise.