How to fix Twitter embed in SharePoint

MFW another API just stops working without returning any errors

Twitter has always been good for developers, except for those who’d like to embed anything – hence making it possible to interact with Twitter’s contents on other sites than Twitter. I guess it’s understandable, but they seem to hate anyone trying to embed feeds, searches or anything on their sites. And they express their hate by making the developers’ lives more difficult… This time by silently breaking the embed script in a way, that’s tricky to work around.

The Problem

In February 2018, Twitter announced that their widgets will start rendering fallback markup on IE9 and IE10 “in the near future”. Since SharePoint 2013 and 2016 are locked in document mode of IE 10 (i.e. using IE on SharePoint sites causes the user agent to be roughly that of IE10), that means basically everyone, who’s using Twitter embeds on SharePoint, will be seeing empty Twitter embeds henceforth. Well, save for SharePoint Online users, since SharePoint Online renders in whatever mode Microsoft chooses that week.

Anyway – that change caused surprisingly small issues. Widgets still rendered, until roughly 2 weeks ago. We started getting reports of Twitter being utterly broken – the embed being completely empty without any fallback rendering whatsoever. What’s worse, the embed fails silently (the code looks like it just checks the user agent and ends the execution – thanks a lot, Twitter, much appreciated!)

What’s even worse, is that it applies to IE11 users, too – if they’re in SharePoint, or on a site that’s running in compatibility mode (such as all sites on “intranet” zone). And since IE seems to be most actively used in large organizations, especially on internal communication channels, Twitter just decided to block the majority of IE users in the world from accessing their service via embeds. 

Great job.

Luckily, there’s a dirty hack for this situation!

Continue reading

Fixing an unhandled exception about StructureMap configuration failing (messed up assembly bindings)

Obama congratulates you on your broken apps

So, you’re running a console program, but while you try running it, you get an error like this: “StructureMap.Exceptions.StructureMapConfigurationException”, with a message like this: “Unable to find the exported Type’s in assembly” (the typo done by Microsoft, not me). There’s a number of reasons for this error, but for a fair share of the time that’s just your assembly bindings being messed up. Luckily, that’s another easy fix!  Continue reading

How to fix AADSTS50059: No tenant-identifying information found in either the request or implied by any provided credentials.

SOLVE ALL THE ERRORS!

Have you run into the cryptical “AADSTS50059: No tenant-identifying information found in either the request or implied by any provided credentials.” error? I have. This post will tell you how to fix it.

How to fix AADSTS50059?

I encountered this error while trying to reload a page with some JavaScript that authenticates against Graph API. It completely blocks the functionality, as it redirects the user to login page. Luckily, at least in my case, this was easily fixed! Your error might look something like this:

Okay – so the error claims Azure AD fails to recognize your tenant, as the request or provided credentials didn’t provide that. But is that even true?  Continue reading

How to show any page in a pop-up in SharePoint

This ages old trick deserves to be published – since it makes it easy to quickly show info from pretty much any another page on pretty much any classic SharePoint page (in a SharePoint-compatible pop-up). So, here goes:

Using SharePoint’s JavaScript library to open an arbitrary pop-up

Yes – SharePoint contains all the functionality out-of-the-box, and you almost don’t have to do anything yourself! Let’s see how this works.

Continue reading

Speaking at SPS Nashville!

SharePoint Saturday Houston session banner

This Spring is crazy – so many cool announcements to make! I’ll be speaking at SharePoint Saturday Nashville on 5.5.2018. This one’s a completely new SPS event for me, and I’m honored my session was accepted on the developer track! Based on the feedback from earlier sessions, I’m really excited to speak to the community about the cool new toys Microsoft is giving us! 🙂

Continue reading

Materials for my SPS TC session: “Citizen Developer Tools are not just for Citizen Developers” now available!

SPS TC logo

Whoops – this post comes quite late, as the session was a couple of weeks ago already.  I recently had a session at SharePoint Saturday Twin Cities (SPS TC for short) and thought I’d share my materials and document my experiences. Oh, and do the shout-outs, since I referenced some and tools by some extremely talented people!

Continue reading

Solving Azure Web Application’s first load perfomance issues

Microsoft Azure logo

Is your Azure Web Application suffering from absolutely horrible load times every time someone accesses it for the first time every 15 minutes or so? Mine was. It was pitiful.

I was developing a web-based service using EF6 and ASP.NET MVC 5, where all the assets were hosted in the Azure. Even though the app was reasonably lightweight and usually responded very fast, the first time someone accessed it in a while it took 20-60 seconds to load AND sometimes even timed out (especially with mobile clients). Load testing revealed only the what I already knew: initial load times were horrendous, but after that everything worked fine. I did eventually find the solution, though!

Continue reading