我正在将Firebase身份验证集成到我的Android应用中 . 成功登录后,Android应用程序将调用在Google App Engine上运行的某些Google Cloud endpoints .
因此,我需要将从身份验证收到的Firebase令牌传递给Google Cloud endpoints . 我使用以下代码来调用 endpoints (source)
MyApi.Builder builder = new MyApi.Builder(AndroidHttp.newCompatibleTransport(),
new AndroidJsonFactory(), null)
myApiService = builder.build();
myApiService.sayHi(name).execute();
那么如何将令牌转发到我的后端呢?
1 回答
您可以使用
HttpRequestInitializer
注入令牌: