I'm trying to authenticate with google-api from a server with the following "old" code:
GoogleTokenResponse tokenResponse =
new GoogleAuthorizationCodeTokenRequest(TRANSPORT, JSON_FACTORY,
CLIENT_ID, CLIENT_SECRET, code, "postmessage").execute();
// Create a credential representation of the token data.
GoogleCredential
credential = new GoogleCredential.Builder()
.setJsonFactory(JSON_FACTORY)
.setTransport(TRANSPORT)
.setClientSecrets(CLIENT_ID, CLIENT_SECRET).build()
.setFromTokenResponse(tokenResponse);
From old releases of google-api for java, JSON_FACTORY was built doing something like this:
JsonFactory JSON_FACTORY = new JacksonFactory();
But since i've updated to version 1.15.0-rc, JacksonFactory is not found. Looks like it has been refactored or removed, but i can't find any example to replace this line of code.
What should i use? Implementation of JsonFactory for sure, but some standard implementation may already exist?
Finally found the JacksonFactory class. It has been separated and is available in the following dependency:
<dependency>
<groupId>com.google.http-client</groupId>
<artifactId>google-http-client-jackson2</artifactId>
<version>1.15.0-rc</version>
</dependency>
So the Java code doesn't change.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With