Check Firebase Token in Google App Engine

I am developing an application on Google App Engine. I use Cloud Endpoints to communicate between an Android application on my backend in Google App Engine. The Android client uses Firebase Authentication and sends a Firebase token to Cloud Endpoints with each call.

In the Google App Engine, I use the following code to verify the Firebase token. I am using Firebase Admin SDK 4.0.3

Task<FirebaseToken> authTask = FirebaseAuth.getInstance().verifyIdToken(token);

try {
    Tasks.await(authTask);
} catch (ExecutionException | InterruptedException e ) {
    log.severe(e.getMessage());
}
FirebaseToken decodedToken = authTask.getResult();

The task is performed as part of the Back App task for the Google App Engine, but, unfortunately, this Backend instance does not complete, and therefore I have exceeded the free quota limit. So can anyone give me a hint how can I shut down the Backend Instance after checking the token?

+2
1

SDK Firebase Admin Java . SDK ( >= 4.0.4), ( ).

, verifyIdToken() 4.1.0 - . , 4.0.4, >= 4.1.1.

! verifyIdToken(), . 4.0.4 .

, verifyIdToken() ​​ 4.1.1 Java Admin SDK.

0

Source: https://habr.com/ru/post/1664400/


All Articles