如何在Java中的Firebase GetAccessToken中设置代理?

时间:2019-02-15 03:50:42

标签: java firebase http proxy firebase-authentication

我在令牌请求中使用Google API(Google Firebase)时需要设置代理服务器

下面是我的Java代码。我需要将代理服务器合并到其中

Proxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress("proxy.xyz.com", 8080)); 

GoogleCredential googleCredential = GoogleCredential.fromStream(new FileInputStream("serviceaccount.json")).createScoped(Arrays.asList(SCOPES));

    googleCredential.refreshToken();

    log.info("Token2 "+googleCredential.getAccessToken());

    return googleCredential.getAccessToken();

0 个答案:

没有答案