How to use Firebase with Spring boot REST Application?
<p>I have a Spring Boot REST application that depends on the authentication done in Firebase.</p>
<p>On the client side Firebase generates a token whereby in the Spring Boot, I need to verify the <code>UID</code>.</p>
<p>But the code is in a callback mode, so how do I implement the function so that it can finish the task?</p>
<pre><code>@RequestMapping(value = &quot;/api/restCall&quot;, method = RequestMethod.POST, 
             consumes = &quot;application/json&quot;, produces = &quot;application/json&quot;)
public Object restCall(@RequestBody Parameters requestBody) throws Exception {
    String idToken = requestBody.getToken();
    Task&lt;FirebaseToken&gt; task = FirebaseAuth.getInstance().verifyIdToken(idToken)
            .addOnSuccessListener(new OnSuccessListener&lt;FirebaseToken&gt;() {
            @Override
                public void onSuccess(FirebaseToken decodedToken) {
                    String uid = decodedToken.getUid();
                }
            });
    return &quot;???&quot;; // what return here?
}
</code></pre>
<p>How do I return after <code>onSuccess</code>? <code>DeferredResult</code>?</p>