Skip to content

chore(docs): update GoogleCredential samples to use google-auth-library #1440

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Feb 12, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
use trusted transport:
  • Loading branch information
chingor13 committed Jan 14, 2021
commit a95f4b957a32eb05413ad0e09814bb2866277ab2
8 changes: 4 additions & 4 deletions docs/oauth-2.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ For instructions on setting up your credentials properly, see the
already have an access token, you can make a request in the following way:

```java
import com.google.api.client.http.javanet.NetHttpTransport;
import com.google.api.client.googleapis.javanet.GoogleNetHttpTransport;
import com.google.api.client.json.gson.GsonFactory;
import com.google.api.services.books.Books;
import com.google.auth.http.HttpCredentialsAdapter;
Expand All @@ -59,7 +59,7 @@ GoogleCredentials credentials =

Books books =
new Books.Builder(
new NetHttpTransport(),
GoogleNetHttpTransport.newTrustedTransport(),
GsonFactory.getDefaultInstance(),
new HttpCredentialsAdapter(credentials))
.setApplicationName("BooksExample/1.0")
Expand All @@ -79,7 +79,7 @@ App Engine takes care of all of the details. You only specify the OAuth 2.0
scope you need.

```java
import com.google.api.client.http.javanet.NetHttpTransport;
import com.google.api.client.googleapis.javanet.GoogleNetHttpTransport;
import com.google.api.client.json.gson.GsonFactory;
import com.google.api.services.books.Books;
import com.google.appengine.api.appidentity.AppIdentityService;
Expand All @@ -99,7 +99,7 @@ GoogleCredentials credentials =

Books books =
new Books.Builder(
new NetHttpTransport(),
GoogleNetHttpTransport.newTrustedTransport(),
GsonFactory.getDefaultInstance(),
new HttpCredentialsAdapter(credentials))
.setApplicationName("BooksExample/1.0")
Expand Down