koltyakov / gosip

⚡️ SharePoint SDK for Go
https://go.spflow.com
MIT License
140 stars 32 forks source link

Returning the 403 forbidden error #65

Open 1shoaibazhar opened 10 months ago

1shoaibazhar commented 10 months ago

I am using the Fluent Api client, also tried the HTTP client, I am getting the 403 forbidden error with correct credentials

Also attaching the list of api permissions I have granted on Azure Screenshot 2023-11-03 at 12 07 44 PM Screenshot 2023-11-03 at 12 08 06 PM Screenshot 2023-11-03 at 12 05 53 PM

koltyakov commented 10 months ago

Hi @1shoaibazhar,

You granted Graph permissions. It's a different API.

You need API Permissions -> SharePoint :: Application :: Sites.FullControl.All -> Grant Admin Consent permissions in Azure app registration.

See more:

1shoaibazhar commented 10 months ago

Hi @koltyakov , I have added the sharepoint sites full control as well, it still returns the same 403 forbidden error

1shoaibazhar commented 10 months ago

@koltyakov , I am using Client Id, Client Secret in the authcnfg

Screenshot 2023-11-03 at 12 47 04 PM

koltyakov commented 10 months ago

So it's not an Azure app which is used but legacy Add-in Only? Azure auth uses tenantId, clientId, certPath, certPass parameters. For Add-in auth you have to enable it and also grant permissions.