Certificates MMC sucks – use powershell!

You can navigate your certificates by opening powershell and doing:

cd Cert:
dir
etc.

A dir of the “my” folder shows thumbprints first which is much more useful to me. The MMC snap-in doesn’t show a thumbprint column.

To find a certificate by thumbprint, do:

dir -recurse | where {$_.Thumbprint -eq “B8421CF9EC87413CB741064C4E798311”} | Format-List -property *

Upgrade to Windows 8.1 broke tethering – workaround/fix

I recently upgraded my laptop to Windows 8.1 from Windows 8 after third party VPN software finally became available. Initially I got BSOD from Intel Wifi driver so upgraded them along with NVidia drivers.

Wifi worked at home but not when tethered to my phone – what’s going on? Troubleshooting revealed a DNS issue.

Turns out Hyper-V (installed as part of Windows Phone SDK) had bridged the Wifi network connection and forced the DNS server to be my home DNS (which explains why my home WiFi worked).

Under network connections: Right-click->Remove this connection from the bridge resolved the issue for me.

SAML vs OAuth

Excellent article by Zach Dennis on the differences between SAML and OAuth2.

http://www.mutuallyhuman.com/blog/2013/05/09/choosing-an-sso-strategy-saml-vs-oauth2/

In a nutshell:

  • SAML 2.0 older specification not good for mobile and non-web devices but more established
  • OAuth2 new kid on the block with similar flows written in the age of mobile devices and native clients but not so tightly specified leading to some incompatibilities

Must create DependencySource on same Thread as the DependencyObject.

Stumped me for a bit because I wasn’t expecting this as a result of the change I made. I was creating a colour in my ViewModel like this:

private readonly Brush[] colours = new[] { Brushes.Black, Brushes.DarkBlue };

But then wanted to use some more funky colours so changed it to:

private readonly Brush[] colours = new[] { new SolidColorBrush(Color.FromRgb(0x04, 0x81, 0x9E)), new SolidColorBrush(Color.FromRgb(0xEC, 0xFC, 0x00)) };

Because I was no longer referencing the static brushes and instead creating them when this class is instantiated (which happened to be on a non UI thread), this caused the above ArgumentException (which had a stack trace and values that really didn’t point to where the error actually occured).

Fixing it meant doing it properly 🙂 I created the brushes in my View and used Style triggers to choose the appropriate brush based on a value in my ViewModel.