Hi, I have connected microsoft teams and am trying to send a teams chat. I seem to be getting this error:
RROR: Forbidden - perhaps check your credentials?
403 - {“error”:{“code”:“Forbidden”,“message”:“No authorization information present on the request.”,“innerError”:{“date”:“2023-10-17T06:59:54”,“request-id”:“81287b59-4657-4d55-979c-0821b86f98df”,“client-request-id”:“81287b59-4657-4d55-979c-0821b86f98df”}}} - No authorization information present on the request.
In Azure under the app I have allowed the following API permissions:
Hi @JohnM, I am very sorry you are having trouble.
Unfortunately it’s not clear me which version of n8n you are using or which request exactly you are sending to the Microsoft APIScreenshot from 2023-10-17 16-39-35. I quickly tried out the below workflow using [email protected]:
Can you confirm the exact version of n8n you are using, share an example workflow and confirm if your OAuth2 credentials are connected? You should see a green “Account connected” status when opening them.
Hi @JohnM, this looks very much like your OAuth2 authentication with MS Teams has expired (or wasn’t completed in the first place). Can try reconnecting your OAuth2 credentials through the credentials screen?
Also, can you confirm the values you are using in each field here (except for any secrets of course) as well as the n8n version you are currently using?
Thanks for confirming @JohnM. Is the user you are authenticating as ([email protected]) a member of the actual MS365 organization you are using MS Teams in? Purely based on the email it seems like this could be a personal account rather than an organization account.
And how exactly have you registered your OAuth2 client in the MS Azure portal? Did you pick the Accounts in any organizational directory (Any Azure AD directory - Multi-tenant) and personal Microsoft accounts (e.g. Skype, Xbox) option during the process?
Yes you’re right it’s a personal account which I’ve Added as an external user to a chat with my work account for testing. Yes I did choose the option which you had circled.
Tbh, I was not aware of any problems with personal team accounts and am fairly certain I have used them in the past (despite “private” and “organization” Teams always being somewhat separate).
That said, my current test account is an org account and Microsoft has changed teams a lot lately. I’ll try to take a closer look when I have a bit more time.
In the meantime the approach suggested by @jhambach might be worth a shot here (sending the message directly to the respective MS API endpoint using the HTTP Request node). This will allow you to configure the request exactly like you want it and will also return the full response from Microsoft.
Just an update for anyone interested, I asked our admin to authorize auth on our organisation account and that one is working fine (so seems like it’s something to do with personal accounts)