firebase / firebase/quickstart-java

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

Ouverte
#49 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
Java
Étoiles
241
Forks
148
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

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@***

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.