Search code examples
microsoft-teamsteams-toolkitmicrosoft-teams-js

Teams SDK initialisation gets timed out sometimes when redirecting to a URL which is in the pattern of given valid domain with wildcard


Process: Our product has multiple clients. Each client has different URL for the application in the same domain. (ex. abc.getnspace.com, def.getnspace.com etc). To accommodate all clients, we have given our default URL as the initial URL of the personal app. We compute the actual URL that the logged in person has to be redirected to, based on user's tenant id.

Issue: We have given *.getnspace.com in the valid domains. All the URLs in this pattern after getting redirected are being initialised just fine except a few. For those few redirected URL's, the SDK initialisation is getting timed out (no pattern found for which URLs the SDK initialising gets timed out).

But the SDK initialisation is working fine, if we include that URL separately in the valid domains list along with the wildcard URL. We couldn't add all our clients as there is a restriction for only 16 valid domains, and it wouldn't be a good option as well because we need to submit a new version of our app every time we need to add or remove a client.

Note:This is not happening with all the clients. Some URLs are getting loaded even if they are not explicitly mentioned in the valid domains list.

Package and version used: [email protected] Image of the error logged


Solution

  • I have also encountered this issue before, and using the team's SDK2. X version will have this issue. Then, I replaced the SDK package with "@ Microsoft/teams js": "1.10.0" version to solve this problem. You can try it out, but I am also looking forward to using the 2. X version to have an effective solution