Reputation: 11
I'm using Firebase Admin Java SDK (https://github.com/firebase/firebase-admin-java). Everything is setup OK, i'm sending tons of messages to google cloud, but from time-to-time FCM replies with http status 401.
FCM requires an OAuth token, and this SDK is requesting them, caching and refreshing, if they are near expiration, so in my opinion this should not happen. But stil...
I've looked around in Firebase Admin Java SDK's code, there is very little logs, that I can turn on and that would help me debug this issue.
httpResponse:
status: 401,
headers: {
cache-control=[private],
content-encoding=[gzip],
content-type=[application/json; charset=UTF-8],
date=[Tue, 03 Dec 2024 19:27:26 GMT],
transfer-encoding=[chunked],
x-frame-options=[SAMEORIGIN],
alt-svc=[h3=":443"; ma=2592000,h3-29=":443"; ma=2592000],
server=[scaffolding on HTTPServer2],
x-content-type-options=[nosniff],
vary=[Referer, X-Origin, Origin],
x-xss-protection=[0]
}
body: null,
httpRequest:
method: POST,
url: https://fcm.googleapis.com/v1/projects/*******/messages:send,
headers: {
accept-encoding=[gzip],
authorization=[Bearer ya29.c.*******],
x-goog-api-format-version=2,
x-firebase-client=fire-admin-java/9.4.1
},
content: com.google.api.client.http.json.JsonHttpContent@23f4fcf7
Upvotes: 1
Views: 31