Issues Downloading Microsoft Sharepoint File using Microsoft OAuth 2 API Credential

Describe the problem/error/question - I’m trying to download a sharepoint file with the HTTP Request node, using the Microsoft OAuth 2 API credential type.

What is the error message (if any)? - either a 401 UNAUTHORIZED or an “Invalid Audience” error

I ensured my Azure enterprise app has the following scoped applied and granted:
Files.ReadWrite.All
Group.ReadWrite.All
Chat.ReadWrite
offline_access
Sites.FullControl.All
Sites.ReadWrite.All

When making the credential - I made sure to swap the authorization and token URL with the following (was receiving a “no refresh token” error using the default values):

https://login.microsoftonline.com/TENANT_ID/oauth2/authorize

https://login.microsoftonline.com/TENANT_ID/oauth2/token

and I requested the following scopes when trying different times:
Sites.FullControl.All
Sites.ReadWrite.All
Files.ReadWrite.All

Has anyone had this issue before or have any ideas on how to solve?

Thanks so much

Information on your n8n setup

  • **n8n version: 1.20.0
  • **Database (default: SQLite): Postgresql
  • **n8n EXECUTIONS_PROCESS setting (default: own, main): queued
  • **Running n8n via (Docker, npm, n8n cloud, desktop app): EKS
  • Operating system:: Linux

Hi @Hidden_Squid, I belive this could be a duplicate of your other thread over here. Let us know if you’re still running into trouble here :slight_smile:

all good! ended up being my permissions, using the generic oauth2 allowed me to request the needed prermissions

2 Likes

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