firebase / firebase/quickstart-java

Error : Error getting access token for service account: Remote host terminated the handshake, iss:

未关闭
#49 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Java
星标
241
派生
148
PR 合并指标
30 天内没有已合并 PR

描述

I'm using below Java snippet to get the Authentication token for Firebase Messaging. But its throwing error during refreshIfExpired method call.

private static String getAccessToken() throws IOException {
String[] SCOPES = {"https://www.googleapis.com/auth/firebase.messaging"};

GoogleCredentials googleCredentials = GoogleCredentials.fromStream(new FileInputStream("./src/service-account.json")).createScoped(Arrays.asList(SCOPES));
//googleCredentials.refresh();
try {
googleCredentials.getAuthenticationType();
googleCredentials.refreshIfExpired();
} catch (IOException e) {
e.printStackTrace();
}

return googleCredentials.getAccessToken().getTokenValue();

}

When i remove refreshIfExpired and call getAccessToken directly also same error is coming. Any suggestion. Are these related to jars? As i have uploaded certain jars downloaded from Maven as i do not find anything on google firebase link.

Error at refreshIfExpired step: Error getting access token for service account: Remote host terminated the handshake, iss: firebase-adminsdk-jnf15@***

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。