Right now it's not possible to create custom JWT token with firebase-admin SDK on Java and this leads to the problems of credentials confidentiality.
The most efficient way to obtain credentials while you're on AppEngine or GCE - obtain them via GoogleCredential.getApplicationDefault(), or in case of Firebase - FirebaseCredentials.applicationDefault(), but FirebaseAuth.createToken lacks support for this type of credentials.
Implementing application default credentials support for custom JWT tokens will help people not to save their credentials in the VCS or gamble with cumbersome environment variables.