title: Google Speech API v1beta1 gRPC API: sample auth code
body: <p>Can someone please show a sample of doing auth for the Google Speech v1beta1 gRPC API on Android? </p>
  
  <p>I'm trying to run the sample code in <a href="https://github.com/GoogleCloudPlatform/java-docs-samples/tree/master/speech" rel="nofollow">https://github.com/GoogleCloudPlatform/java-docs-samples/tree/master/speech</a>.</p>
  
  <p>It runs fine on OSX and within Eclipse; when I try on Android I get different results.</p>
  
  <p>Specifically, in the part:</p>
  
  <pre><code>private ManagedChannel createChannel(String host, int port) throws IOException     {
      try {
          ...
          GoogleCredentials creds = ...
          creds = creds.createScoped(OAUTH2_SCOPES);
  
          ManagedChannel channel =
                  ManagedChannelBuilder.forAddress(host, port)
                          .intercept(new ClientAuthInterceptor(creds, Executors.newSingleThreadExecutor()))
                          .build();
  </code></pre>
  
  <p>I get the complaint that ClientAuthInterceptor is deprecated, and in javadoc for <code>io.grpc.auth</code> it says "use GoogleAuthLibraryCallCredentials instead", which it appears is from <a href="https://github.com/grpc/grpc-java" rel="nofollow">https://github.com/grpc/grpc-java</a> :any examples of success using that?</p>
  
  <p>In OSX/Eclipse I'm using the sample code "as is" while on Android I'm reading the JSON Google credentials from a file, though the credentials returned seem similar.</p>
  
  <p>Thanks!</p>