【问题标题】:how to import LocalServerReceiver()?如何导入 LocalServerReceiver()?
【发布时间】:2017-03-17 07:32:21
【问题描述】:

我有这段代码,但在 maven-repository 中找不到

要导入的正确库。有人知道是哪个吗?

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");
}

我找不到 com.google.api.client.extensions.jetty

https://mvnrepository.com/search?q=com.google.api.client.extensions.jetty

【问题讨论】:

    标签: java maven google-cloud-platform google-authentication


    【解决方案1】:

    给你: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>
    

    【讨论】:

      猜你喜欢
      • 2021-08-20
      • 2016-11-11
      • 2011-09-27
      • 2021-12-05
      • 2020-04-04
      • 2016-04-07
      • 2014-03-26
      • 2012-01-07
      • 2018-01-20
      相关资源
      最近更新 更多