Homer Simpson was once quoted as saying “To alcohol! The cause of, and solution to, all of life's problems”. I can’t help but borrow from it and say that Claims-Based Authentication is the cause of, and solution to, most problems with identity consumption in applications.
When people first come across Claims-Based Authentication there are two extremes of responses:
- Total amazement at the architectural simplicity and brilliance
- Fear and hatred of the idea (don’t you dare take away my control of the passwords)
Each has a valid truth to them, but over time you realize all the problems sit somewhere between both extremes. It’s this middle ground where people run into the biggest problems.
Over the last few months there’s been quite a few people talking about the pains of OpenID/OpenAuth, which when you get right down to the principle of it, is CBA. There are some differences such as terminology and implementation, but both follow the Trusted Third Party Authentication model, and that’s really what CBA is all about.
Rob Conery wrote what some people now see as an infamous post on why he hates OpenID. He thinks it’s a nightmare for various reasons. The basic list is as follows:
- As a customer, since you can have multiple OpenID providers that the relying party doesn’t necessarily know about, how do you know which one you originally used to setup an account?
- If a customer logs in with the wrong OpenID, they can’t access whatever they’ve paid for. This pisses off said customer.
- If your customer used the wrong OpenID, how do you, as the business owner, fix that problem?
- Is it worth fixing?
- Is it worth the effort of writing code to make this a simpler process?
- “I'll save you the grumbling rant, but coding up Open ID stuff is utterly mind-numbing frustration”. This says it all.
- Since you don’t want to write the code, you get someone else to do it. You find a SaS provider. The provider WILL go down. Laws of averages, Murphy, and simple irony will cause it to go down.
- The standard is dying. Facebook, Google, Microsoft, Twitter, and Joe-Blow all have their own particular ways of implementing the standard. Do you really want to keep up with that?
- Dealing with all of this hassle means you aren’t spending your time creating content, which does nothing for the customer.
The end result is that he is looking to drop support, and bring back traditional authentication models. E.g. storing usernames and passwords in a database that you control.
Following the Conery kerfuffle, 37signals made an announcement that they were going to drop OpenID support for their products. They had a pretty succinct reason for doing so:
Fewer than 1% of all 37signals users are currently using OpenID. After consulting with a fair share of them, it seems that most were doing so only because that used to be the only way to get single sign-on for our applications.
I don’t know how many customers they have, but 1% is nowhere near a high enough number to justify keeping something alive in any case.
So we have a problem now, don’t we? On paper Claims-Based Authentication is awesome, but in practice it’s a pain in the neck. Well, I suppose that’s the case with most technologies.
I think one of problems with implementations of new technologies is the lack of guidance. Trusted-Third Party authentication isn’t really all that new. Kerberos does it, and Kerberos has been around for more than 30 years. OpenID, OpenAuth, and WS-Auth/WS-Federation on the other hand, haven't been around all that long. Given that, I have a bit of guidance that I’ve learned from the history of Kerberos.
First: Don’t trust random providers.
The biggest problem with OpenID is what’s known as the NASCAR problem. This is another way of referring to Rob’s first problem. How do you know which provider to use? Most people recognize logo’s, so show them a bunch of logo’s and hopefully they will pick the one that they used. Hoping your customer chooses the right one every time is like hoping you can hit a bullseye from 1000 yards, blindfolded. It could happen. It won’t. But it could.
The solution to this is simple: do not trust every provider. Have a select few providers you will accept, and have them sufficiently distinguishable. My bank as a provider is going to be WAY different than using Google as a provider. At least, I would hope that’s the case.
Second: Don’t let the user log in with the wrong account.
While you are at it, try moving the oceans using this shot glass. Seriously though, if you follow the first step, this one is a by product. Think about it. Would a customer be more likely to log into their ISP billing system with their Google account, or their bank’s account? That may be a bad example in practice because I would never use my bank as a provider, but it’s a great example of being sufficiently distinguishable. You will always have customers that choose wrong, but the harder you make it for them to choose the wrong thing, the closer you are to hitting that bullseye.
Third: Use Frameworks. Don’t roll your own.
One of the most important axioms in computer security is don’t roll your own [framework/authn/authz/crypto/etc]. Seriously. Stop it. You WILL do it wrong. I will too. Use a trusted OpenID/OpenAuth framework, or use WIF.
Forth: Choose a standard that won’t change on you at the whim of a vendor.
WS-Trust/Auth and SAML are great examples of standards that don’t change willy-nilly. OpenID/OpenAuth are not.
Fifth: Adopt a provider that already has a large user base, and then keep it simple.
This is an extension of the first rule. Pick a provider that has a massive number of users already. Live ID is a great example. Google Accounts is another. Stick to Twitter or Facebook. If you are going to choose which providers to accept, make sure you pick the ones that people actually use. This may seem obvious, but just remember it when you are presented with Joe’s Fish and Chips and Federated Online ID provider.
Finally: Perhaps the biggest thing I can recommend is to keep it simple. Start small. Know your providers, and trust your providers.
Keep in mind that everything I’ve said above does not pertain to any particular technology, but of any technology that uses a Trusted Third Party Authentication model.
It is really easy to get wide-eyed and believe you can develop a working system that accepts every form of identification under the sun, all the while keeping it manageable. Don’t. Keep it simple and start small.