As a software developer of Google Glass software, one of the ongoing challenges I’ve faced is the authentication of users in GDK Glassware. Glassware built using the Mirror API had native authentication methods from the beginning, but with side-loaded GDK apps, each developer has been left to their own devices when authentication to a web service was needed.
This has led to varied approaches for GDK authentication against a web service: scanning of QR codes, entering a code displayed after authentication, or the extreme measure of connecting a bluetooth keyboard to your Glass device just to enter your credentials. Needless to say, all of these methods are a bit of a hassle.
Now Google has published a solution for user authentication against a web service in GDK Glassware. The following diagram, published on Google’s developers page under GDK authentication, explains the process:
As you can see, when users enable your Glassware in MyGlass they are redirected to your sign-in page for your associated web service. Then, your web service validates the user via Mirror API using the user’s Google credentials. This is also the step where you will present the user with the specific permissions you are requesting (aka incremental authentication). Finally, Mirror API sends the user’s account information to the user’s Glass device. Now your GDK Glassware can access the associate web service on behalf of the validated user account via the AccountManager object in the GDK.
Google’s published approach to GDK Glassware and web service authentication is a huge time saver and definitely the way it should be done. Currently, the only drawback is Google’s limitation on utilizing this method. According to Google:
Currently, you can only test and use this API after we’ve uploaded your APK to MyGlass, which happens during the review process.
That’s right! Before you can even test this approach, your GDK Glassware must be submitted for review to MyGlass. This, of course, means the whole time you beta test your Glassware, you still need to use an alternative web service authentication method. However, once beta testing is finished, Google will permit you to submit your Glassware for review with the stipulation that you still need to test authentication. You can even request a whitelist of Google users for testing purposes.
In the end, Google’s solution for GDK Glassware authentication is the perfect solution we’ve been waiting on. Thanks Google!
Source: Google Developers Site