title: Upload/Downloading files to Google Drive in Windows Store App
body: <p>I am able to sign into Google using the <a href="http://code.msdn.microsoft.com/windowsapps/Web-Authentication-d0485122/sourcecode?fileId=52289&amp;pathId=1917124598" rel="nofollow">web authentication sample</a>. Here's the code:</p>
  
  <pre><code>    private async void Launch_Click(object sender, RoutedEventArgs e) 
      {    
          if(GoogleClientID.Text == "") 
          { 
              rootPage.NotifyUser("Please enter an Client ID.", NotifyType.StatusMessage); 
          } 
          else if(GoogleCallbackUrl.Text == "") 
          { 
              rootPage.NotifyUser("Please enter an Callback URL.", NotifyType.StatusMessage); 
          } 
  
          try 
          { 
              String GoogleURL = "https://accounts.google.com/o/oauth2/auth?client_id=" + Uri.EscapeDataString(GoogleClientID.Text) + "&amp;redirect_uri=" + Uri.EscapeDataString(GoogleCallbackUrl.Text) + "&amp;response_type=code&amp;scope=" + Uri.EscapeDataString("http://picasaweb.google.com/data"); 
  
              System.Uri StartUri = new Uri(GoogleURL); 
              // When using the desktop flow, the success code is displayed in the html title of this end uri 
              System.Uri EndUri = new Uri("https://accounts.google.com/o/oauth2/approval?"); 
  
              DebugPrint("Navigating to: " + GoogleURL); 
  
              WebAuthenticationResult WebAuthenticationResult = await WebAuthenticationBroker.AuthenticateAsync( 
                                                      WebAuthenticationOptions.UseTitle, 
                                                      StartUri, 
                                                      EndUri); 
              if (WebAuthenticationResult.ResponseStatus == WebAuthenticationStatus.Success) 
              { 
                  OutputToken(WebAuthenticationResult.ResponseData.ToString()); 
              } 
              else if (WebAuthenticationResult.ResponseStatus == WebAuthenticationStatus.ErrorHttp) 
              { 
                  OutputToken("HTTP Error returned by AuthenticateAsync() : " + WebAuthenticationResult.ResponseErrorDetail.ToString()); 
              } 
              else 
              { 
                  OutputToken("Error returned by AuthenticateAsync() : " + WebAuthenticationResult.ResponseStatus.ToString()); 
              } 
          } 
          catch (Exception Error) 
          { 
              // 
              // Bad Parameter, SSL/TLS Errors and Network Unavailable errors are to be handled here. 
              // 
              DebugPrint(Error.ToString()); 
          } 
  }       
  </code></pre>
  
  <p>After the app authenticates, I'm not sure how to go about using file operations. Their is a .Net library that Google has made available but it doesn't seem to work for Windows store apps.</p>
  
  <p>Here is the doc upload files over http:</p>
  
  <p>Google Drive api: <a href="https://developers.google.com/drive/manage-uploads" rel="nofollow">https://developers.google.com/drive/manage-uploads</a></p>
  
  <p>I tried using the <a href="http://code.msdn.microsoft.com/windowsapps/HttpClient-sample-55700664" rel="nofollow">HttpClient sample</a> but wasn't sure how to use the authentication token that I got from the authentication sample.</p>