gpt4 book ai didi

java - 如何导入 LocalServerReceiver()?

转载 作者:行者123 更新时间:2023-11-29 07:32:20 30 4
gpt4 key购买 nike

我有这段代码,但是我在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

最佳答案

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

关于java - 如何导入 LocalServerReceiver()?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40406183/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com