0
votes

I want to make the glassware, it can take picture and upload taken picture to Google Plus with location information, insert a new card into timeline.

For the uploading the picture to Google Plus with native code by the the glassware, it need to use oAuth flow with GDK. So, that means our server should have to get "userToken" parameter by redirected callback URL according to the guideline of the authorization with GDK.

I also have to pass the flow of the authorization with Mirror API for getting the location information, inserting a new card into timeline. It means our server should have to get "code" parameter by redirected callback URL according to the Mirror API guideline.

However, when i submit the glassware on glassware's submit web page, i can just insert 1 Client ID into "Client ID" form.

According to the glassware guide line, the GDK have to insert the Client ID of Service and the Mirror API have to insert the Client ID of Web Application.

What i have to insert the Client ID into the submit web page ??

How can pass the authorization flow both the GDK and Mirror API ??

1

1 Answers

0
votes

If you want to use both GDK auth and the Mirror API to insert items in the timeline, this is the steps that need to happen:

  1. Create one single API Project in the APIs Console and enable the Mirror API --> seems that you've already done that.
  2. Create client IDs:
    1. Create a "Client ID for Web Application": this is the one you are going to use when inserting items in the timeline through the Mirror API
    2. Create a "Client ID for Service Account": this is the one you are going to use when calling the GDK authentications APIs.
  3. Give the API Project ID to the review team: this is the set of numbers that is in the URL (e.g https://console.developers.google.com/project/<PROJECT_ID>/...).
  4. Give an auth URL to the review team: this should be a URL that points to your web server so you can retrieve the ?userToken query parameter for GDK authentication.

When the user clicks on "Install" in MyGlass and is redirected to your auth URL:

  1. Retrieve and save the ?userToken query parameter.
  2. Redirect the user to the OAuth 2.0 authorization URL (you could use the ?state query parameter to pass along the ?userToken query parameter for later use).
  3. Once the user has approved the scopes and is redirected to your redirect URL, exchange the authorization code for OAuth 2.0 tokens (eventually retrieving the userToken in the ?state query parameter if you've used it in step #2).
  4. Push whatever tokens you need through the GDK authentication API using the saved userToken.