how to set permissions in getPFTATPOPAuthHeader/getPFATAuthHeader for one drive graph app token

Tarun Gupta 21 Reputation points Microsoft Employee
2022-11-17T18:15:20.373+00:00

I am using PFT token to call the one drive graph api, getting 403 accessDenied error.
From here: https://learn.microsoft.com/en-us/onedrive/developer/rest-api/concepts/errors?view=odsp-graph-online
I came to know that it is because of not enough permissions.

I need to have the sample code and commands to run on local to call one drive graph apis.
I am following this: https://office.visualstudio.com/ISS/_git/augloop-workflows?path=/workflows/example-auth/src/example-graph-auth-workflow.ts

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,546 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,662 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Tong Zhang_MSFT 9,116 Reputation points
    2022-11-18T06:08:46.397+00:00

    Hi @Tarun Gupta ,

    According to my research and testing, if you want to set permissions for Microsoft Graph, please register your app at the Azure app registration portal, and then configure permissions for Microsoft Graph, at last get administrator consent. Please refer to the specific steps in the document to configure permissions: https://learn.microsoft.com/en-us/graph/auth-v2-service#authentication-and-authorization-steps

    More information for reference: Microsoft Graph permissions reference

    Hope it can help you. Thanks for your understanding.


    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.