Sharepoint 403 forbidden error

In my locally hosted n&n application. Im trying to connect my sharepoint to read/write files. I have set up all the necessay azure application registration permissions and my connection is also verified in credentials. But im getting 403 error in both site id, folder id and file id dropdowns. This is not the case in my cloud trial account. If i use the actual ids by pulling it from graph same error perisits. Anyone faced this issue can you explain how you solved it.

Thanks in advance

You are most likely missing a required permission granted to the MS/Azure app.

There is an explanation of how MS permissions/grants work here.

Thanks for the reply

Is there an updated document with al the necessary permissions needed for sharepoint node. As i have followed and granted all the necessary permissions mentioned in the doc and more. But still the 403 error persists.

It has been a while since I tried to navigate this and get something working, but iirc the required permissions and type of grant (delegated vs. app-only) was a bit of a guessing game.

One other “easy to miss” aspect of it is that there is an extra step for “app-only” permissions.

  1. Grant the permission to the app.
  2. An administrator must then consent to the granted app-only permission.

Maybe that’s what you need still? Not sure.

Hey thanks for the reply.

I added almost any permission and in the credential page the connection is verified and i can see success pings in my app security log. The only issue arises is from when i try to pull any file or upload any. If i use my personal access token and run https request. I am able to download the same file from sharepoint using graph explorer. Will try and guess any other permissIons but i am still lost in this process.
For reference these are the permissions i have added

I didn’t keep enough detail in my notes to remember, but I did run into a similar issue.

As far as I remember, I couldn’t ever reference docs/etc. in Sharepoint with the account/user-name format of the graph api URL, so I ended up having to:

  1. grab the drive id from https://graph.microsoft.com/v1.0/sites/root/drives
  2. find/access folders/docs via https://graph.microsoft.com/v1.0/drives/{the-root-drive-id}/root/children

Sorry I can’t remember more context, but it’s at least something to try as a workaround.

Got you, I have also followed the above method to manually pull ids from graph api and that throws the same forbidden 403 error. Delving deeper into permission to figure out why. If you have any other context on the same would help a lot. Thanks

I looked back at the app-only permissions I added. It wasn’t that extensive. The ones I noticed that weren’t in your list are Directory.Read.All and Sites.Read.All Maybe try adding those.

4 Likes

Okay thank you so much will look into it for sure

Hey, good news this solved the sharepoint error. Thank you so much.

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.