Open frankShih opened 1 month ago
In my case for method 2 error message is: Message: AADSTS700016: Application with identifier 'client_id' was not found in the directory 'MY_TENANT'. This can happen if the application has not been installed by the administrator of the tenant or consented to by any user in the tenant. You may have sent your authentication request to the wrong tenant.
I need to download all files from certain path. Now I do it manually
Therefore, I want to access sharepoint files with my personal account and download files manually. Below is my code snippet:
For method 1, do not know how to get the token because my account has 2FA setup. So I can not get token from account&password directly. I go to https://developer.microsoft.com/en-us/graph/graph-explorer to get an access token (I do not know if it is OK) Then I got
('-2147024891, System.UnauthorizedAccessException', 'Attempted to perform an unauthorized operation.', "403 Client Error: Forbidden for url: https://MY_TENANT.sharepoint.com/sites/MY_SITE/_api/Web/getFolderByServerRelativeUrl('%2FShared%20Documents')")
For method 2, I got message from a popup webpage:
AADSTS50011: The redirect URI 'http://localhost:54764' specified in the request does not match the redirect URIs configured for the application '3b3555c0-1822-46a7-9a03-2979989152e9'. Make sure the redirect URI sent in the request matches one added to your application in the Azure portal. Navigate to https://aka.ms/redirectUriMismatchError to learn more about how to fix this.
Please give me some suggestions. Thanks .