Hi Amit:
You've hit on an important point in access control that causes a lot
of confusion. The really important thing to decide is just what are
you trying to authenticate: a user or an app (or both)? API keys are
OK for identifying client-side apps (like an iPhone app that accesses
a news server using APIs). But since every instance of the app shares
the same API key, this approach can't really be used to differentiate
access between individual users. As you and others have pointed out,
API keys are very vulnerable to hijacking, so they should not be
considered a really authoritative ID (that is, ultimately used as a
basis for something that matters, like charge backs, or access to
important data).
If in contrast you want to control access on a user-by-user basis,
then you are into good old fashioned access control using familiar
human-centric security tokens (basic auth, certs, or better yet OAuth
derived from one of these). In this case, think of the problem the
same way you would if it was just a conventional web site where you
have to manage the life cycle of these user IDs. Yup, it's a pain, so
the best option is often to use existing IDs, like FB or Twitter
(maybe not linkedin this week...) and then authorize individual access
based on this (so you still need to keep track of who you are managing
and their current entitlements).
Personally I would go with OAuth here, kicked off using something
simple like basic auth if you are managing the user store. Certs bound
to a user are an option, but the distribution has always been a world
of hurt that you want to avoid unless you have the MDM-style
infrastructure to support it. Put the access control on the API so
only currently authorized users (ie: those that hold a current
subscription) can get through. I would only try encrypting the content
if I was doing some kind of time-limited DRM, which is a much bigger
and more complex problem.
Regards
Scott
http://www.layer7.com