Update. We are no longer calling the proposed protocol SimpleAuth. We are now calling it SAAAM: Simple Authentication and Authorization in the Age of Mobile.
In social login, pioneered by Facebook Connect, a site or application (the client) is granted access to the user’s account at a social network (the server). It then learns the identity of the user by accessing the user’s profile, and performs operations such as issuing social updates on behalf of the user. This combination of authentication and authorization is a powerful idea, which must be credited with making third-party login popular on the Web at large.
We have now entered the Age of Mobile. Will social login be as successful in the mobile world? It should be even more succesful, since not having to enter a password on a tiny touch-screen keyboard is a great benefit to the user. But there is no standard protocol today that is suitable for native mobile applications. Actually, there is no protocol, standard or proprietary, that covers all four use cases obtained by combining a native or online application in the role of social login client with a native or online application in the role of social login server.
Let’s consider each use case in turn:
- Native server and native client.
Both the server and the client have created native applications that can be installed in the user’s mobile device to serve as front-ends. Both must have online back-ends as well. It is obvious that the server must have a back-end. The client must also have a back-end if it maintains its own user accounts, which I assume is the case by definition for social login.
This case is supported by Facebook as a social login server, with native front-ends for iOS and Android. But there is no protocol that the client can use to login with Facebook via a native Facebook application. Instead, the client front-end must incorporate proprietary code provided by a Facebook SDK into its own code.
- Native server and online client.
This is the case where the client is a Web application that the user accesses through a mobile browser, and the server is a social network that has a native front-end installed on the user’s mobile device. Since native front-ends are under user control, they cannot be trusted to authenticate the user; hence the client must obtain the user’s identity from the back-end of the social network; but the user interface for obtaining user consent should be handled by the native front-end of the social network.
To my knowledge, this case is not supported at all today.
- Online server and native client.
This case has been discussed recently on the OAuth 2.0 mailing list [1] (threads Report an authentication issue and proposal of a paragraph to add to the security considerations section). Native clients use the OAuth 2.0 implicit flow to provide social login via Facebook, but the implicit flow allows user impersonation by an attacker who uses a rogue client. Many native clients have been confirmed to be vulnerable [2][3]. Some native clients have addressed the vulnerability using proprietary and undocumented Facebook APIs [4][5].
Several participants in the discussion argued that OAuth 2.0 is not designed or intended for authentication, i.e. for social login. Yet OAuth 2.0 is the protocol that’s being used for social login by at least Facebook, Twitter, LinkedIn, Google and Yahoo.
The editor of the OAuth 2.0 specification had this to say [6]:
The sad reality is, we’ve spent 3 years producing a specification that is less secure, more complex, and does not interoperate the way OAuth 1.0 does.
It does scale better for huge companies like Google, Microsoft, and Yahoo. No wonder they wanted it this way.
When asked, I tend to advise people using OAuth 1.0 to just keep using it.
Oh well.
However, it’s not clear how OAuth 1.0 can be used for social login by a native client, since it makes use of a long client secret that could not be stored securely in the native client front-end.
- Online server and online client.
This case at least should be covered, shouldn’t it? It’s not, because OAuth 2.0 relies on the same implicit flow when the client is a Web 2.0 application implemented in JavaScript and running within the browser. And the implicit flow allows user impersonation in this case as in the case of a native client [7].
Another problem of OAuth is that it requires prior registration of the client with the server. Clients can only afford the time and effort it takes to register with a few social networks. Because of this, and because relying on the native front-end of a social network requires incorporating proprietary code provided by an SDK, social login is a feature that only Facebook and other top-tier social networks can offer to their users. Many other social networks out there cannot take advantage of it.
OpenID Connect is an extension of OAuth that tries to fix some of the problems of that protocol, at the cost of extraordinary complexity. OpenID Connect adds six specifications to the already large number of OAuth-related specifications. It solves the user impersonation vulnerability of the implicit flow by introducing another token, the ID Token, in addition to the authorization code and the two kinds of access tokens of OAuth. It tries to solve the prior registration problem with a dynamic registration protocol, but does not provide any practical means of authenticating the client as it registers.
Why is social login such a mess? Is it because designing a secure social login protocol is intrinsically difficult? It’s certainly not trivial, but that’s not the problem. The problem is the approach that has been followed so far, i.e. start with a pre-Web 2.0 authorization protocol and add layers of complexity to handle social login, Web 2.0 applications, and native applications. The result is not pretty.
What if we started from scratch and tried to design a social login protocol for the Age of Mobile, without being constrained by legacy protocols? We’ve tried that at Pomcor and we have come up with a preliminary design of a social login protocol that we call SAAAM: Simple Authentication and Authorization in the Age of Mobile [8]. It’s much simpler than other authentication or authorization protocols, it supports native applications as client and server front-ends, it does not require prior client registration, and it provides strong security; or at least we think so; please let us know if you find any security glitches or have any other comments.
References
[1] |
OAuth Mailing List Archive.
http://www.ietf.org/mail-archive/web/oauth/current/maillist.html.
|
[2] |
Rui Wang. [OAUTH-WG] Report an authentication issue, 14 Jun 2012 10:18:16 -0700.
http://www.ietf.org/mail-archive/web/oauth/current/msg09270.html.
|
[3] |
Nat Sakimura. Re: [OAUTH-WG] Report an authentication issue, 15 Jun 2012 05:50:50 +0900.
http://www.ietf.org/mail-archive/web/oauth/current/msg09273.html.
|
[4] |
Nat Sakimura. Re: [OAUTH-WG] Report an authentication issue, 16 Jun 2012 09:16:42 +0900.
http://www.ietf.org/mail-archive/web/oauth/current/msg09316.html.
|
[5] |
Nov Matake. Re: [OAUTH-WG] Report an authentication issue, 16 Jun 2012 12:22:23 +0900.
http://www.ietf.org/mail-archive/web/oauth/current/msg09321.html.
|
[6] |
Eran Hammer. Re: [OAUTH-WG] proposal of a paragraph to add to the security considerations section, 21 Jun 2012 14:17:08 +0000.
http://www.ietf.org/mail-archive/web/oauth/current/msg09373.html.
|
[7] |
John Bradley. The problem with OAuth for Authentication, January 28, 2012.
http://www.thread-safe.com/2012/01/problem-with-oauth-for-authentication.html.
|
[8] |
F. Corella and K. Lewison. SAAAM: Simple Authentication and
Authorization in the Age of Mobile. Revised June 25, 2012.
http://pomcor.com/whitepapers/SAAAM.pdf.
|
Sounds like SAAAM solves an important problem you’ve thought a lot about. Very cool…
(FYI: On page 9 of the SAAAM paper, it reads “Androed” instead of “Android”.)