IsmaelMartinez / teams-for-linux

Unofficial Microsoft Teams for Linux client
GNU General Public License v3.0
2.8k stars 232 forks source link

Meeting links are not 'trapped' within teams-for-linux #1410

Open jdpipe opened 1 week ago

jdpipe commented 1 week ago

Describe the bug When clicking a Teams 'join meeting' link in the Teams-for-linux calendar tab, I am directed out to Firefox and the meeting attempts to start in Firefox, instead of in the Teams-for-Linux client.

To Reproduce

  1. Go to teams-for-linux
  2. Go to the calendar tab
  3. Click on a meeting invitation (from an outside organisation). Find the 'join meeting' button.
  4. Click the 'join meeting' link
  5. Firefox opens the link and redirects to the meeting within Firefox.

Expected behavior Expect the meeting to open within Teams for Linux.

Screenshots Not applicable.

Desktop (please complete the following information):

Debug Not done

Additional context I note that my organisation uses aus01.safelinks.outlook.microsoft.com as a server for protecting users from phishing links etc. Perhaps teams-for-linux needs to do some processing on clicked links before handing off to firefox. Alternatively, perhaps a firefox add-in is needed to kick the request back to teams-for-linux.

joakim-tjernlund commented 1 week ago

This feels very similar to: https://github.com/IsmaelMartinez/teams-for-linux/issues/1379

IsmaelMartinez commented 1 week ago

Hi @jdpipe , I think your URL been different would be then ignored by the regex that is used to determine if it is a meeting link.

The regex is in here, https://github.com/IsmaelMartinez/teams-for-linux/blob/develop/app/config/index.js#L242 and you can use that config option to modify it and see if it works. Otherwise you can check the redirector option described in https://github.com/IsmaelMartinez/teams-for-linux/issues/1098#issuecomment-1965770510 . Hopefully one of those 2 options will get you sorted.

I don't think is the same @joakim-tjernlund , as @jdpipe indicates the aus01.safelinks.outlook.microsoft.com is their base URL (what would mean the app things is not a teams link and open it externally), but thanks for sharing your thoughts.

joakim-tjernlund commented 1 week ago

I don't think is the same @joakim-tjernlund , as @jdpipe indicates the aus01.safelinks.outlook.microsoft.com is their base URL (what would mean the app things is not a teams link and open it externally), but thanks for sharing your thoughts.

You are right, @jdpipe you should ask IT to make an exception for these links.

jdpipe commented 6 days ago

I don't think this is really a solution -- these 'safelinks' are applied across one's organisation as a direct response to the fact that they know there are non-Outlook/non-Windows users (ie the kind of people who try using Teams-for-Linux), in order to 'protect' us. I think that dereferencing safelinks is a necessary part of implementing the Teams-for-Linux successfully. Each time I get a Teams invitation from a new organisation, it's likely to result in another new 'exception'. Not really workable.

Here is an example of a safelink in full, as I receive it. You can see that it encodes my email address (xxx.xxx@...) and other stuff. But fortunately, to turn this back into an 'unsafe' link, it's a simple enough matter of extracting the 'url' parameter from the query string. Of course MS could change the encoding so that this is not possible, forcing all users to make a request to the MS server before the real URL is returned, but this is how it is for now.

https://aus01.safelinks.protection.outlook.com/?url=https%3A%2F%2Ftheconversation.cmail20.com%2Ft%2Fr-l-tddikdjl-hrbttjhky-ih%2F&data=05%7C02%7Cxxx.xxx%40xxxx.xxx.au%7C8fac37f276e546516b8508dcd9bc1afc%7Ce37d725cab5c46249ae5f0533e486437%7C0%7C0%7C638624649175004816%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=o2sf53WiptOxqOQMnWNLgzPWPbRJPas3XPR1X3X3Dk4%3D&reserved=0

Here are a couple of codes that can do this demangling. I've tested the first, but not the second:

https://github.com/jdpipe/unmangleOutlookSafelinks/blob/master/src/display.js

and

https://github.com/atc0005/safelinks

jdpipe commented 6 days ago

here is the official info on the safelinks stuff, FYI https://learn.microsoft.com/en-us/defender-office-365/safe-links-about

IsmaelMartinez commented 4 days ago

Hi @jdpipe , did you try the regex that I mention? It might not work but is not clear from your answer if you tried it or not.

Another thing to try is copy and paste the link into your chat channel and then ctrl+click the link and see if it opens in the app.

I don't know enough about safe-links (or any tbh) but will have a look. I suspect it would still need to open in your browser but then the redirection should go back to teams, if you got your file associations configured correctly.