Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

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

Open
#49 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
25/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
firebase, java

Research direction

The only entry point shown is getAccessToken(), which reads service-account.json and calls refreshIfExpired(). Start by reproducing the handshake failure and checking the Maven JARs and runtime or network setup; done requires a confirmed cause and verified access-token retrieval.

Written by the indexing model from the issue text.

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

Dominant language
Java
Stars
241
Forks
148
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from firebase/quickstart-java

All issues in firebase/quickstart-java

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.