首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何导入LocalServerReceiver()?

如何导入LocalServerReceiver()?
EN

Stack Overflow用户
提问于 2016-11-04 00:01:52
回答 1查看 5.7K关注 0票数 5

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

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

代码语言:javascript
复制
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

EN

回答 1

Stack Overflow用户

发布于 2016-11-05 04:10:54

给你:https://mvnrepository.com/artifact/com.google.oauth-client/google-oauth-client-jetty/1.22.0

代码语言:javascript
复制
<dependency>
    <groupId>com.google.oauth-client</groupId>
    <artifactId>google-oauth-client-jetty</artifactId>
    <version>1.22.0</version>
</dependency>
票数 11
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/40406183

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档