Parth Doshi
Parth Doshi

Reputation: 4208

How does Google Glass authentication work?

I am trying to create a sample test application that authenticates a user wearing Google Glass.

I have read the following page

https://developers.google.com/glass/develop/gdk/authentication

I need to know how will the authentication actually work. Now lets say I have an app "XYZ" uploaded onto MyGlass. User turns on the app via MyGlass and then automatically gets redirected to a web page say, for example,

http://www.example.com/glass/authenticate.html

In this web page, he has to sign in using a username and password. Once he clicks submit will he be redirected to another webpage on the browser or will the Glass application get activated. Where will the userToken be obtained. Will it be on Glass?

I am really confused. Please can someone help me out.

What exactly is the flow for authentication on Glass?

Upvotes: 0

Views: 249

Answers (1)

PabloC
PabloC

Reputation: 404

Assuming you're doing 3rd part authentication (i.e. your own users, not google accounts).

Once you click Submit on your login page:

  1. Server-side: If the user is valid, call the Mirror API to insert the account, including your authToken and the userToken. The userToken will be a query parameter added to your login url by the glassware store.
  2. Close the page using window.close(). The Glassware will then be installed on the user's device.
  3. When the user launches your glassware, retrieve the account from the Mirror API, and then retrieve the authToken that you inserted in step 1. for that particular account.

Upvotes: 1

Related Questions