2

So, I am trying to create a file in a user's Google Drive. Once I figured out how to do so using Glass compatible API's, I ran into a UI problem... I can't figure out how to hit "OK".

When authenticating a user, the following image appears:

Cancel/OK image

Is this not the correct approach? Below is the authentication call:

    accountManager.getAuthToken(accounts[0], "oauth2:https://www.googleapis.com/auth/drive", null, this, new AccountManagerCallback<Bundle>() {
        @Override
        public void run(AccountManagerFuture<Bundle> future) {
            try {
                authToken = future.getResult().getString(AccountManager.KEY_AUTHTOKEN);
                createSpreadsheet(accountName);
            }
bguggs
  • 46
  • 3

1 Answers1

1

No, this isn't the correct approach. Users shouldn't be authorizing actions through Glass, but should be authorizing at app install time.

See https://developers.google.com/glass/develop/gdk/authentication for details about the process flow to do so.

Prisoner
  • 49,922
  • 7
  • 53
  • 105
  • Okay. The linked page says that in order to use the API for entering credentials at install time we need to upload the APK to MyGlass, which happens during the review process. How can I authorize at install time while creating/testing the app? – bguggs Jul 16 '14 at 18:00
  • Does it mean that I need to create my own authentication page in order to let the user use an API owned by Google? (ie. Drive API) I don't understand how I can apply the authentication flow described in the documentation if I just want to use a Google API. – Arthur Ferreira Jul 18 '14 at 05:46