firebase / firebase/quickstart-java

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

オープン
#49 コメント 0 件 リアクション 0 件 担当者 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 を短くまとめたダイジェスト。