Cannot send teams chat

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:

I’m not sure what I’m doing wrong?

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]:

n8n runs this node as expected:

The message also comes through in MS teams as expected:

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.

This is how it looks on n8n cloud:

On a self-hosted instance the credentials screen would look like so instead:

Thanks for your reply. I am hosting this in ec2, version 1.9.3

I recorded a video showing the authorisation of the connector and the issue I’m facing. Does this help?

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?

image

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?

Hi @MutedJam,

it’s Version 1.9.3

here is a video of me re-authenticating and then facing the same issue

and here is the screenshot of the details I’m using to authenticate

thanks

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.

Is it an issue to use a personal account?

@MutedJam could you clarify what the limitation is (if any) in terms of non-organisational accounts? I don’t see any reference to that here:

I don’t use the Teams node for this (I use HTTP) but my endpoint for it is https://graph.microsoft.com/beta/chats/{{chatid}}/messages

1 Like

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)

thanks for your help

1 Like

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