by Steve Syfuhs
According
to Wikipedia:
A Federation is multiple computing and/or network providers
agreeing upon standards of operation in a collective fashion.
Practically
speaking, it’s a way to bind two disparate systems together in such a way that
allows both systems to understand the same data and work toward a specific
goal. Okay, so maybe that wasn’t as practical an explanation as I hoped.
Federation is a concept that helps us share information across multiple systems.
Federation
is an increasingly important aspect of identity management as more and more
systems become interconnected. Federation bridges different identities across
different systems so we don’t end up with insurmountable collections of siloed
user data. Federation helps reduce stale user information, reduces the sprawl
of repetitive identities, and most importantly gives users and their
organizations a better security posture.
In
this installment of Tech Tuesday we'll begin a new series looking at the vices
and virtues of Identity Federation and Single Sign-On.
Single Sign-On
Single
Sign-On (SSO) is built around this concept of identity federation. SSO works by
creating a trust relationship (the federation) between two or more different
systems that agree upon sharing a specific piece of information – the user’s
identity. The goal is to centralize the location of a user's identifying
information and hopefully reduce the number of authentications necessary to use
the systems. Practically speaking this means fewer usernames and passwords to
manage. This relationship is usually codified through protocols like SAML,
WS-Federation, OpenID, etc.
In
the SSO world, both parties agree on the protocol and trade some information
with each other once so they can prove the shared data hasn’t been tampered or
forged. When the trade is complete, federation is configured and Single Sign-On
can occur.
Licenses, Drivers
To
understand the benefit of Federation and Single Sign-On we need to understand
the trust relationship. The relationship model we use for Single Sign-On
parallels that of government-issued ID's.
Imagine
for a moment you are wanting to go the bar and order a drink. The bartender is
legally obligated to verify your age. He has a few ways he can do this, but
most of them are impractical. Apparently cutting someone open and counting the
rings doesn't quite work like it does for trees, but I digress. So he relies on
your government-issued photo ID.
Verifying your government-issued photo ID solves a couple problems for the bartender. The ID contains special information that describes the holder of the identity like date of birth. The bartender does a simple check: is the date of birth on the card far enough back to legally allow you to drink? The bartender has a relationship with the government so he's reasonably certain he can trust the information on the ID, but now he has to verify if the ID is real or not. He does this by verifying certain properties of the ID exist that were previously agreed upon between him and the government. These properties are things like inlayed holograms under the laminate, State seals, or special codes on the magnetic strip on the back of the card. With these properties he can reasonably determine if the ID is genuine because the properties are supposed to be very hard to reproduce by 3rd parties.
Finally, the bartender has to verify the ID actually belongs to you. This is where that photo part comes in. The ID would be pretty useless (or rather, extremely valuable) if using it didn't require the holder to be verified -- anyone holding the ID could use it. If the ID is simply a laminated card that you carry around in your pocket you run the risk of someone stealing it and impersonating you. So there's a photo on it to tie you to the ID. The bartender needs to compare the photo on the ID to you. If you look alike there's a reasonably good chance you are the one entitled to use the ID.
When you put everything together you get an ID that only you can use, but can be
trusted and verified by any number of people that understand that trust
relationship. This basic trust model is used in Federated Single Sign-On.
The Protocols
There
are quite a number of publically and privatively documented protocols used for
SSO, however there are a few well known protocols that are used in the majority
of SSO implementations. These protocols are:
- Kerberos
- SAML (Security Assertion Markup
Language)
- WS-Federation/WS-Trust
- OpenID/OAuth
- CAS (Central Authentication Service)
Each
protocol is unique, but they all share some important similarities. Basically,
they talk to their friends the same way. Each party in the SSO relationship is
essentially the same across all protocols.
The
relationship consists of two parties: the source of the identity and the
receiver of the identity. Each protocol calls the parties something different,
but suffice to say they all mean the same thing. For the sake of simplicity
we'll be referring to the source of the identity as the Identity Provider
and the receiver of the identity as the Relying Party. These names
coincide with Microsoft naming conventions.
The
Identity Provider provides the identity in the form of opaque token,
and the Relying Party relies on the identity provided in the token.
A token is generally a specially crafted chunk of XML or binary data. The
Identity Provider is like the government agency issuing the photo ID, the photo
ID is the token, and the Relying Party is like the bartender verifying the ID.
Simple, right?
With
all of that being said, let's take a look at how this works in the wild.
Federating Salesforce.com
Salesforce.com
is the quintessential cloud application. It's a perfect candidate for identity
federation because it can be used by so many people in an organization, it's
simple to configure, and all it's users benefit greatly from having one less
password to remember. We'll be looking at Salesforce.com as an example here and
in future posts.
Federating
is the act of creating a trust relationship between the Identity Provider and
Relying Party. In this case the Relying Party is Salesforce.com and the
Identity Provider can be whatever we want to trust as an authoritative source
for our identity. Selecting a proper Identity Provider is a great topic for
another post, but seeing as I'm the guy behind the AuthAnvil Single Sign On
product I might be remiss in not talking about it as much as possible. So lets
use that.
Assume
for a moment we have a working Salesforce.com account and a working AuthAnvil
Single Sign On instance. Creating the trust relationship is fairly
straightforward and the exact steps can be found in our integration guide. If we take a look at the configuration, we can see a few
important pieces of information that need to be exchanged. This exchange allows
Salesforce.com to trust the token AuthAnvil Single Sign On provides.
First,
the relying party needs to know who the token came from. This is called the Issuer.
The issuer is kind of like the agency that issued our government ID, e.g.
Department of Motor Vehicles, and the relying party decides whether it's
willing to trust the token based on this value.
Second,
the relying party needs to know how it can verify the issued token hasn't been
modified in transit or created by an untrusted 3rd party. This is where that Signing
Certificate is used. The signing certificate has a private key that is
owned by the identity provider and is used to sign the token. It never leaves
the Identity Provider. If the token is improperly modified in transit the
signature is invalidated, and an attacker can't recreate the signature because
they need access to that private key. If you can't get the private key you
can't create the signature. To verify the signature you only need the signing
certificate's public key, which can be shared, well, publically. The signature
is like the photo ID's hologram. The design of the hologram as well as the
method of verifying it's authenticity is public knowledge, but the hologram
itself is really difficult to forge.
Third,
the relying party needs to know where it can get a new token. This is the
federation endpoint. Each protocol works differently, but this endpoint is
central to the whole process as it's where the user is sent to get a token
useful to the relying party. This is kind of like the DMV office (but with less
waiting and better turnaround time).
Forth,
the relying party needs to know how to interpret the identity information. Part
of this is implicitly handled by the nature of the protocol, but a lot of times
the protocol is vague about the information it provides so we need to help it
along. Compare this to a government-issued ID. Generally speaking we have a
photo ID, but each agency issues the ID with different information. The ID's
are cards, roughly 3.5" x 2.25" in dimension, and contain personally
identifying information, but each agency uses different layouts and markings.
Humans are pretty good at understanding the differences between layouts, but
computers kind of suck at it unless we help.
Finally,
the identity provider needs to know who is requesting the token. Sadly I may
have stretched our government-issued ID analogy a bit too far by this point. To
limit the misuse of our issued token, the identity provider stamps it with a
marking that defines who is supposed to receive the token. This is called the Audience
URI. Amongst doing other things, this prevents the relying party from
forwarding the token to another relying party and impersonating the user.
NOTE: This
diverges from the driver’s license analogy because the original use of a driver’s
license was to simply prove the license holder was allowed to drive a car. It
was later transformed to allow for multiple uses such as validation of age
which doesn't work with our analogy. We don't really want that behavior with
Federated Single Sign-On for reasons a bit out of scope right now.
Once
this exchange has taken place a user can log into Salesforce.com via AuthAnvil
Single Sign On.
Our
next post in this series will take a deeper look at tokens and see just how
important they are to Single Sign-On (spoilers: they are very important).
Want to learn more about how AuthAnvil can benefit your business? Check out the free eBook below.