Skip to content

Commit

Permalink
Updated comments which looked outdated to me.
Browse files Browse the repository at this point in the history
The example here:
https://developers.google.com/identity/sign-in/web/backend-auth
Shows:
new GoogleIdTokenVerifier.Builder(transport, jsonFactory)
But doesn't show where the transport or jsonFactory come from.

It was easy to find the right JSON library from the left-nav here:
https://developers.google.com/api-client-library/java/google-http-java-client/setup

But it was not so easy to find a HTTPTransport from that page or from the Javadoc here:
https://github.com/google/google-http-java-client/blob/dev/google-http-client/src/main/java/com/google/api/client/http/HttpTransport.java

Both those sources suggested that plain old Java projects use com.google.api.client.javanet.NetHttpTransport which I could not find.  But com.google.api.client.googleapis.javanet.GoogleNetHttpTransport was already included in the google-api-cient and worked for me!

The suggestion to use GoogleNetHttpTransport came from here:
https://developers.google.com/google-apps/tasks/quickstart/java#step_3_configure_the_project_build

I hope this is helpful.
  • Loading branch information
Glen K. Peterson authored and mattwhisenhunt committed Feb 15, 2018
1 parent 356bf78 commit 673d732
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,10 @@
* </li>
* <li>Other Java environments
* <ul>
* <li>{@code com.google.api.client.googleapis.javanet.GoogleNetHttpTransport} is included in
* google-api-cient 1.22.0, so easy to include.</li>
* <li>{@code com.google.api.client.javanet.NetHttpTransport} is based on the HttpURLConnection
* built into the Java SDK, so it is normally the preferred choice.</li>
* built into the Java SDK, so it used to be the preferred choice.</li>
* <li>{@code com.google.api.client.apache.ApacheHttpTransport} is a good choice for users of the
* Apache HTTP Client, especially if you need some of the configuration options available in that
* library.</li>
Expand Down

0 comments on commit 673d732

Please sign in to comment.