Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Microsoft teams user agent

Anyone know the name of user agent used by Microsoft Teams to parsing website ? A customer put a link of my website on his microsoft teams but link is not rendering correctly because is not redirect to my prerender.

like image 353
Anthony Avatar asked Oct 15 '25 15:10

Anthony


1 Answers

On 13 January 2022, the User-Agent strings of the browser used to render Teams Tab content were as follows (running in a small sample of various contexts):

Microsoft Teams (work or school) desktop app my x64 Windows 11 machine:

Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Teams/1.4.00.32771 Chrome/85.0.4183.121 Electron/10.4.7 Safari/537.36

Teams Android App:

Mozilla/5.0 (Linux; Android 11; M2102J20SG Build/RKQ1.200826.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/97.0.4692.70 Mobile Safari/537.36 TeamsMobile-Android

Teams Web App running in Chrome 97 on Windows:

Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36

I got these by creating a simple tab app that loaded the content URL https://www.httpbin.org/headers, which is a public service that just echoes the request headers in the response, then navigating to that Tab in Teams in the various contexts above.

Long story short: As is often the case with user-agent sniffing, it doesn't seem sensible here to depend on the user agent string in your application in any way, because it varies quite a lot depending on the Teams context from which the request is made. Even if you were to try to match "Teams" or "TeamsMobile" for the "app" cases, it doesn't seem documented anywhere and Microsoft could well change it in future. So, my suggestion is to forget about the Microsoft Teams user agent.

like image 141
sammy34 Avatar answered Oct 18 '25 04:10

sammy34