0

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?

Parth Doshi
  • 4,200
  • 15
  • 79
  • 129

1 Answers1

1

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.
PabloC
  • 404
  • 2
  • 13
  • Thanks @PabloC for your answer. I have a few questions. Do I need to store the authToken in a database on the server? Also, can you tell me how is the server side implemented? Do I need to use the Google Java client API – Parth Doshi Sep 05 '14 at 12:41
  • You can do what you want with the authToken. You can request it again if you don't have it, or you can store it in memory for subsequent requests that require authentication with that token. With regards to the client libraries (https://developers.google.com/glass/tools-downloads/client-libraries), you can use which ever library language you feel most comfortable with or that you have environment support for. I used .NET, for example. – PabloC Sep 05 '14 at 12:56
  • ok thanks ..I will try it . I will post my queries over here if any problem..is that fine? – Parth Doshi Sep 05 '14 at 14:20
  • Hi @PabloC ..can u also please share your .NET server side code if possible – Parth Doshi Sep 06 '14 at 03:17
  • also can u tell which .jar files have you used? – Parth Doshi Sep 07 '14 at 05:58
  • please help over here http://stackoverflow.com/questions/25707789/the-method-execute-is-undefined-for-the-type-mirror-accounts-insert – Parth Doshi Sep 07 '14 at 06:46