将新的 Firebase Cloud Functions 与 admin sdk 结合使用。
我想使用 admin.auth().createCustomToken() 函数。调用此函数会导致错误消息
Error: createCustomToken() requires a certificate with "private_key" set.
at FirebaseAuthError.Error (native)
at FirebaseAuthError.FirebaseError [as constructor] (/user_code/node_modules/firebase-admin/lib/utils/error.js:25:28)
at new FirebaseAuthError (/user_code/node_modules/firebase-admin/lib/utils/error.js:90:23)
at FirebaseTokenGenerator.createCustomToken (/user_code/node_modules/firebase-admin/lib/auth/token-generator.js:62:19)
at Auth.createCustomToken (/user_code/node_modules/firebase-admin/lib/auth/auth.js:89:37)
at /user_code/index.js:29:26
at process._tickDomainCallback (internal/process/next_tick.js:129:7)
如何配置云功能以使用 private_key?
admin.initializeApp(functions.config().firebase);