私は新しいデータベースと3.0クライアントライブラリに移行します。私はPATCH
を実行してFirebase DB内のリソースを更新するカスタム認証トークンを生成する部分を更新しています。これに基づいてadmin
請求使っFirebaseする当社のサーバーによってなされるために使用カスタムトークンを使用してFB DBへのREST要求を管理者として作成
これらのPATCHリクエスト:
:新しいDBについては https://www.firebase.com/docs/rest/guide/user-auth.htmは、私はこのような(ruby-jwt
を使用して)JWT・トークンを生成しています
payload = {
aud: "https://identitytoolkit.googleapis.com/google.identity.identitytoolkit.v1.IdentityToolkit",
claims: custom_claims.merge({ admin: true }),
exp: now_seconds + (60 * 60), # Maximum expiration time is one hour
iat: now_seconds,
iss: service_account_email,
sub: service_account_email,
uid: uid
}
JWT.encode(payload, private_key, "RS256")
PATCH
このトークンをFirebase DBに要求すると、次のエラーが発生します。Missing claim 'kid' in auth header
。
クロスポスト:https://groups.google.com/forum/#!topic/firebase-talk/XTJfiltow-I –