I have a Java Rest API running with Jersey on a Glassfish server, and I use Firebase Auth to authenticate my users.
So I use the Firebase Admin SDK to verify the token FirebaseAuth.getInstance().verifyIdToken(idToken)
But it throws the following error:
sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
I initialize my app correctly, by calling:
FirebaseOptions options = new FirebaseOptions.Builder().setCredentials(GoogleCredentials.fromStream(serviceAccountStream)).build();
With serviceAccountStream an InputStream to my service account JSON file.
Edit: I got the same problem with Firebase's auth emulator and other Firebase services such as Firestore, that's weird