Install Root CA cert in Android emulator

When developing a small Xamarin forms app I wanted the android emulator to connect to an intranet identity provider. That didn’t work. The id server was using an SSL certificate issued by an untrusted CA. Here’s what I did to get it working. First, you will need the CA certificate so android can trust the SSL cert. If you don’t have the cert, you can export it using Chrome on mac or Chrome on windows:...

July 7, 2018 · 1 min · LPains

Building string with placeholders

Last post I showed a cool way to parse strings into typed objects. In this one, I want to show the opposite. How to build strings using a template and an object. The idea is to use a template like {BirthDate:D} My name is {FirstName} {LastName} and I'm cool. and an object with properties BirthDate, FirstName and LastName to fill in the placeholder values and apply optional formatting. There are several uses for a utility like this but my favorite use is templated email messages....

April 13, 2017 · 1 min · LPains

Parsing text into typed objects using RegEx named groups

A little while ago, I had to build a desktop app that received input from devices which I had no control of. Although each implementation had similar requirements, the devices connected to the app were slightly different and so were the inputs received from them. I’ve looked for other similar implementations and found that some people implemented device specific parsers. Furthermore, they used configuration to select the correct parser. I think there is at least one issue with this approach: any change to the known inputs would require the application to change as well....

April 6, 2017 · 2 min · LPains

Using html5 canvas to build a WYSIWYG label designer

Fact check: market thermal label systems are freaking expensive. Maybe I could build my own label WYSIWYG designer? Should be simple, right? To spice things up, I decided to try building this as a web solution. Thus, I started playing with html5 canvas to draw text, barcodes, rectangles and images. Once the design was created I could save the configuration for the items drawn and create actual printer specific commands....

January 31, 2017 · 2 min · LPains

MVC with Windows Authentication and WIF

Overview In the previous post, I proposed a “better” way to handle authentication and authorization in web applications for Enterprise. What I’m going to demonstrate in this post is something rather common in corporate intranets: How to integrate Windows Authentication for intranet web applications using MVC, Windows Identity Foundation 4.5 (WIF) and Claims based auth. WIF 4.5 From MSDN: Windows Identity Foundation 4.5 is a set of .NET Framework classes for implementing claims-based identity in your applications....

October 20, 2016 · 4 min · LPains