0

I have just created an App in Azure Portal by following this Article.

I have followed the following Steps:

  1. Registered App in Azure AD
  2. Get the Client ID and Secret from the Registered App
  3. Created API Permissions for the newly Created App in Azure Portal. have granted the following Permissions:

Microsoft Graph

Application permissions:

Sites.FullControl.All: Have full control of all site collections

SharePoint

Application permissions:

Sites.FullControl.All: Have full control of all site collections

  1. Generated the Access Token by hitting the following API from PostMan

    https://accounts.accesscontrol.windows.net/befcd140-15d5-4713-a86a-02fec98214ba/tokens/oAuth/2

The Access Token is generating Successfully but when I try to hit GetListItems API using PostMan, it returns following Exception:

   <m:code>-2147024891, System.UnauthorizedAccessException</m:code>
    <m:message xml:lang="en-US">Attempted to perform an unauthorized operation.</m:message>

enter image description here

I have also added the following Permissions:

At this Page, https://engro2.sharepoint.com/_layouts/15/appinv.aspx , I retrieved App using Client ID then Added the following Permissions:

<AppPermissionRequests AllowAppOnlyPolicy="true">

<AppPermissionRequest Scope="http://sharepoint/content/sitecollection" Right="FullControl" />

</AppPermissionRequests>

Please Help me in resolving this.

Thanks

1 Answer 1

0

You'll need Sites.Read.All permission on the SharePoint permissions blade. Full Control does not give you permission on list items.

Also they'll need to be Application permissions, not delegated.

The Graph and AppInv permissions, you do not need them.

1
  • Granted. still same Oct 12, 2023 at 5:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.