You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm taking over this feature that creates an event on a user's calendar. Our system was previously able to do this using com.google.api.client.googleapis.auth.oauth2.GoogleCredential, but since that's been deprecated, I'm looking for another way to replicate this feature.
This is how we previously did it (on groovy):
import com.google.api.client.googleapis.auth.oauth2.GoogleCredential
import com.google.api.services.calendar.Calendar
import com.google.api.client.googleapis.javanet.GoogleNetHttpTransport
import com.google.api.client.json.jackson2.JacksonFactory
import com.google.api.services.calendar.model.Event
. . .
GoogleCredential credential = new GoogleCredential().setAccessToken(accessToken)
Calendar service = new Calendar.Builder(
GoogleNetHttpTransport.newTrustedTransport(),
JacksonFactory.getDefaultInstance(),
credential)
.setApplicationName("applicationName")
.build();
Event event = new Event()
. . .
service.events().insert("primary", event).execute()
With the com.google.api.client.googleapis.auth.oauth2.GoogleCredential deprecated, would it be correct to assume that the com.google.auth.oauth2.GoogleCredentials will be taking its place?
I tried using the new .GoogleCredentials (we're now in java) but I can't seem to re-use the same code flow in the previous implementation since the 3rd argument requires an httRequestInitializer
Is there another way to use the accessToken given after a user gives the app permissions? I'd like to lessen the changes in the code as much as possible.
The text was updated successfully, but these errors were encountered:
I'm taking over this feature that creates an event on a user's calendar. Our system was previously able to do this using
com.google.api.client.googleapis.auth.oauth2.GoogleCredential
, but since that's been deprecated, I'm looking for another way to replicate this feature.This is how we previously did it (on groovy):
With the
com.google.api.client.googleapis.auth.oauth2.GoogleCredential
deprecated, would it be correct to assume that thecom.google.auth.oauth2.GoogleCredentials
will be taking its place?I tried using the new
.GoogleCredentials
(we're now in java) but I can't seem to re-use the same code flow in the previous implementation since the 3rd argument requires anhttRequestInitializer
Is there another way to use the accessToken given after a user gives the app permissions? I'd like to lessen the changes in the code as much as possible.
The text was updated successfully, but these errors were encountered: