我在我的代码中初始化了 SDK Admin,但是当我调用一个 admin 函数时,它会抱怨凭据和令牌。知道这可能是由什么引起的吗?
var serviceAccount = require('../../../path to the actual json file);
admin.initializeApp({
credential: admin.credential.cert(serviceAccount),
databaseURL: 'https://<name of my database>.firebaseio.com'
});
Run Code Online (Sandbox Code Playgroud)
Error fetching user data: Error: Credential implementation provided to initializeApp() via the "credential" property failed to fetch a valid Google OAuth2 access token with the following error: "Error fetching access token: Error while making request: incorrect header check. Error code: Z_DATA_ERROR".
at FirebaseAppError.FirebaseError [as constructor] (error.js?8304:42)
at FirebaseAppError.PrefixedFirebaseError [as constructor] (error.js?8304:88)
at new FirebaseAppError (error.js?8304:122)
at …Run Code Online (Sandbox Code Playgroud)