Posts

Showing posts from August, 2014

Strong passwords.... Or not

I absolutely hate password "strength" plugins - they're almost always terrible. I use a password manager so all my passwords are generated according to the rules of the website I'm on to be as strong as the site will allow (within reason). So I was on NPower trying to register, it told me up to 20 chars, mixed case and at least one number. I got my password manager to generate me a 20 character mixed case password with numbers. I forgot to tick the box for special characters. The results for strength of password were alarming:  . @InfoSecInsanity nearly chose a bad password for @npowerhq but thanks to the PW strength test "Strong" now #FAIL pic.twitter.com/aLyCU184Q6 — Robert Head (@RobHead89) August 29, 2014 So 20 random chars is the same strength as "Orange1"? Add a space to the end (or any special character) and it's suddenly stronger? Who writes these things anyway? Validating the strength of a password is really bloody ...

Trimming strings in action parameters in ASP.Net Web API

In standard MVC it's very easy to create a model binder to trim all of the strings passed into action methods. The approach I used for that was from here:  http://blogs.taiga.nl/martijn/2011/09/29/custom-model-binders-and-request-validation/ . It works well and it trims the properties of models too. The problem came when I tried to do the same thing for Web API. I added a similar StringTrimmingBinder and registered it as a service using the very non-discoverable API: var provider = new SimpleModelBinderProvider( typeof ( string ),  new StringTrimmingModelBinder()); GlobalConfiguration.Configuration.Services.Insert( typeof (ModelBinderProvider),  0,  provider); As a side note, I have no idea how you're supposed to find out how to register a model binder without opening up Bing and Googling it. Anyway, this worked great when the parameters to the action were actually strings but doesn't work with complex types as parameters. Now, I'v...

It's good to share... have a play icon

Image
I'm sure I'm not the only developer who has needed a really simple image and haven't wanted to bother a designer (or haven't had access to one). It can be really annoying searching for an icon and having to either pay for a set even though you only need one or having to adhere to strict licensing rules.  All I needed was a play button to overlay on a thumbnail. To save other people the bother, and as an uncharacteristically good deed: here's the play button image I made, free forever to abuse to your heart's content. You can  view or download it here .

What to do when the Microsoft Azure preview portal wont load...

Image
I'm in love with the new portal for MS Azure. It rocks my socks off. You can imagine my dismay when I opened it up one day and was confronted not with my normal lovely dashboard but a blank blue screen. After some initial snooping in the network tab of Chrome's dev tools I found a request that kept 500'ing - never a good sign. I decided that there must be something in the request that I was sending that Azure wasn't enjoying. Looking at the request a bit more, I decided it was most likely to be a related to a cookie value - I wish I'd saved the request because I can't remember why I decided that now! I wanted to clear the cookies related to the portal.azure.com domain without having to nuke everything. I opened up dev tools in Chrome, went to the 'resources' tab and expanded the cookies node. I right clicked the "portal.azure.com" cookie and hit "Clear". When I reloaded the page, it all bounced back into life and I could...