waleedAhmad1 / google-glass-api

Automatically exported from code.google.com/p/google-glass-api
0 stars 0 forks source link

Issues with mirror.accounts.insert #650

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I am trying to construct an application with functionality similar to your
example provided on:

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

I am trying to use the mirror.accounts.insert function as described in your 
reference:

/**
 * Creates an account and causes it to be synched up with the user's Glass.
 * This example only supports one auth token; modify it if you need to add
 * more than one, or to add features or user data or the password field.
 *
 * @param mirror the service returned by getMirrorService()
 * @param userToken the user token sent to your auth callback URL
 * @param accountName the account name for this particular user
 * @param authTokenType the type of the auth token (chosen by you)
 * @param authToken the auth token
 */
public static void createAccount(Mirror mirror, String userToken, String 
accountName,
    String authTokenType, String authToken) {
  try {
    Account account = new Account();
    List<AuthToken> authTokens = Lists.newArrayList(
        new AuthToken().setType(authTokenType).setAuthToken(authToken));
    account.setAuthTokens(authTokens);
    mirror.accounts().insert(
        userToken, ACCOUNT_TYPE, accountName, account).execute();
  } catch (IOException e) {
    e.printStackTrace();
  }
}

but you don't tell me where i can get the param "authToken".where i can get it?

Original issue reported on code.google.com by lensZh...@gmail.com on 26 Dec 2014 at 6:47

GoogleCodeExporter commented 8 years ago
Hello,

Thanks for the report but this does not seem like an issue. For those kind of 
questions, I would recommend posting them on StackOverflow with the 
google-glass tag.

To answer your question, the authToken is for you to provide, it is the token 
that you want to retrieve from your APK on Glass.

Best,
Alain

Original comment by ala...@google.com on 7 Jan 2015 at 5:36