I have this code, but I cannot find in maven-repository
the right library to import. Does someone knows which is it?
import com.google.api.client.extensions.jetty.auth.oauth2.LocalServerReceiver;
/** Authorizes the installed application to access user's protected data. */
private static Credential authorize() throws IOException {
dataStoreFactory = new FileDataStoreFactory(DATA_STORE_DIR);
// set up authorization code flow
GoogleAuthorizationCodeFlow flow = new GoogleAuthorizationCodeFlow.Builder(
TRANSPORT, JSON_FACTORY, clientSecrets, SCOPES).setDataStoreFactory(
dataStoreFactory).build();
// authorize
return new AuthorizationCodeInstalledApp(flow, new LocalServerReceiver()).authorize("user");
}
I couldn't find com.google.api.client.extensions.jetty
https://mvnrepository.com/search?q=com.google.api.client.extensions.jetty
Here you go: https://mvnrepository.com/artifact/com.google.oauth-client/google-oauth-client-jetty/1.22.0
<dependency>
<groupId>com.google.oauth-client</groupId>
<artifactId>google-oauth-client-jetty</artifactId>
<version>1.22.0</version>
</dependency>
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