Rest API for SharePoint

Ranjeet Pawar 21 Reputation points
2022-04-27T14:41:57.657+00:00

Hi All,

I am doing activities to get the file from SharePoint for that I am using Rest API. But getting below error message looks like security and firewall issue from SharePoint.

Error message : Embedded message: (-1) - Unable to set HTTP OAuth2 Authorization on connection. Error getting access token; Caused by: Unable to set HTTP OAuth2 Authorization on connection. Error getting access token; Caused by: Error getting access token; Caused by: invalid_request, AADSTS900192: Unable to determine the tenant identifier from the request.

Can someone help me here to resolve this issue.

Thanks in advance for your help !

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,802 questions
SharePoint Server Development
SharePoint Server Development
SharePoint Server: A family of Microsoft on-premises document management and storage systems.Development: The process of researching, productizing, and refining new or existing technologies.
1,597 questions
SharePoint Server Management
SharePoint Server Management
SharePoint Server: A family of Microsoft on-premises document management and storage systems.Management: The act or process of organizing, handling, directing or controlling something.
2,893 questions
{count} votes

Accepted answer
  1. Tong Zhang_MSFT 9,141 Reputation points
    2022-04-28T07:24:04.823+00:00

    Hi @Ranjeet Pawar ,

    Thank you for the detailed description of the case.

    When I received the case, I searched a lot of documents did a lot of researches. And I feel regretful to inform you that no documentation has been found can resolve this error now.

    As a workaround, I recommend you try to use Postman and check if can get the "Access_token". Then get the file from SharePoint using Rest API;

    Steps:

    1. Follow the steps in the documentation to get the "Access_token" (as shown in the following screenshot).
      197200-image.png

    For reference:
    Working with files by using REST API

    Note: Microsoft is providing this information as a convenience to you. The sites are not controlled by Microsoft. Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. Please make sure that you completely understand the risk before retrieving any suggestions from the above link.


    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.



0 additional answers

Sort by: Most helpful