Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to import LocalServerReceiver()?

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

like image 575
Elad Benda Avatar asked Nov 03 '16 16:11

Elad Benda


1 Answers

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>
like image 198
jmruc Avatar answered Sep 18 '22 22:09

jmruc