I have registered an app in Microsoft Entra. I give it the appropriate write permissions for Sharepoint.
When I press connect in the n8n credentials, I get a Microsoft user query:
The n8n workflow should not connect to Entra as a user but as an application. Otherwise it does not get the rights assigned to the application but those of the user.
What else am I doing wrong?
Perhaps this microsoft link is even more meaningful: Get access without a user
I do not want to register as a user at entra, but as an application.
Is this supported by n8n?
I’m encountering the same issue. Initially, I connected using a Microsoft User account before setting up credentials with Basic OAuth2. When switching to Basic OAuth2, the user profile login screen didn’t appear, so I assumed it connected directly to the app I created in Entra for posting messages in Teams. The messages still appear as though they’re posted by the user account, not the app.
I’m also having troubles with token refreshing, despite configuring the scope in Entra. @peter_s are you experiencing this too?
During my first attempts, I had selected ‘Authorisation Code’ as the grant type in the OAUTH2 API credentials and got the Microsoft login window for user selection. This may have been the wrong way.
Now I am testing the grant type ‘Client Credentials’. Now I don’t get the user selection window (great!). However, the error message ‘Access token is empty.’ now appears in my workflow. Is this the same error as yours @timon?
If I test the same credentials with Postman, it works as desired!
Does the token query have to be built manually within the workflow in n8n?
All I know is that it worked for a while, but then an issue arose where the access token was not refreshed. I had to manually reconnect each time, and then it would work again temporarily. I’ve tried everything in the scope settings, including enabling offline access, but nothing has resolved it.
I can’t say for certain if we’re experiencing the exact same issue.
@timon: Which grant type do you use, Client Credentials? My first attempts with ‘Authorisation Code’ were probably wrong.
In the meantime I have managed to connect successfully, but without using the credentials section in n8n. Instead, I build the token request manually in the workflow, with HTTP Request.
Nevertheless, I would like to know how the OAUTH2 credentials are used correctly with client credentials so that a token can be requested in the workflow. I would be grateful for any help.