Maybe you are an Android user and wondered how sometimes the browser logs you in without asking for a password?
Well, I wondered but never found the time to investigate.
Thanks to the awesome W3C Web Cryptography Next Steps Workshop and thanks to the usual jet-lag I found that time now. First I thought that this is Google-ism "Chrome does some questionable proprietary trick and knows just how to login to Google accounts". That is half-true.
There is chatter on the chromium list but I seems that the Android browser knows this trick since 2011 and Chrome for Android was released in 2012.
So how does it work?
- a site responds with a special HTTP header "X-Auto-Login"
- the browser sees that header
- the browser asks the device's account system for local accounts for the realm parameter of the header (e.g. realm=com.google)
- the browser asks for a special kind of token from that account
- the browser asks the user for consent to login
- the token is an URL - so if the user consents the browser opens that URL
- the site the URL points to accepts the token
- the site redirects the browser to the original page the user wants to use
I think this is neat. But why doesn't Google talk about it? Why isn't this standardized at W3C?
Anyway. How can you benefit?
As a user? You already do.
As a website with your own mobile app?
- Well, Google is probably not issuing tokens for your site. Maybe they do or would do because they want to be an identity provider?...
- Issue the tokens yourself.
- What you need on the Android device is an AccountAuthenticator.
- let your website issue the X-Auto-Login HTTP header "realm=com.yourdomain&args=..."
- let your Account Authenticator from step a generate tokens based on 'String authTokenType="weblogin:" + args;'
- let your site accept the tokens generated by your Account Authenticator.
I think this is a good idea. If your company has an mobile app then build that Account Authenticator. This is even more true if your company has several mobile apps. (Put the authenticator in your own CompanyServices.apk (like Google does with the GooglePlayServices) so you can update independently from your apps.)
You might know that I work for a 100% subsidiary of Deutsche Telekom. Why isn't DT doing this? Don't ask me. I am telling them for years that our own AccountAuthenticator would be "gold". But who listens to me. Working for a big company has its challenges.
Back to wondering... How can we get this or something similar standardized through W3C?
Maybe I should write a blog post to make it more known. But then who reads this blog anyway. ;-)
Thanks for listening.