Firebase以管理员身份进行身份验证 [英] Firebase authenticate as admin
问题描述
是否有一个标准的或建议的方式来做到这一点?
authWithCustomToken现在是signInWithCustomToken(firebase版本3.x) 文档示例: Is there a way I can authenticate with Firebase as an administrator of a firebase for full read/write access to it (already has security rules protecting parts of it), or will I have to write a security rule that somehow allows me access to the full firebase, for example by providing a certain password/key. Is there a standard or suggested way of doing this? See this for the 'latest' documentation. authWithCustomToken is now signInWithCustomToken (firebase version 3.x) Example from the documentation:
这篇关于Firebase以管理员身份进行身份验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
firebase.auth()。signInWithCustomToken(token).catch(function (error){
//处理错误
var errorCode = error.code;
var errorMessage = error.message;
if(errorCode ==='auth / invalid -cus tom-token'){
alert('您提供的令牌无效');
} else {
console.error(error);
}
});
firebase.auth().signInWithCustomToken(token).catch(function(error) {
// Handle Errors here.
var errorCode = error.code;
var errorMessage = error.message;
if (errorCode === 'auth/invalid-custom-token') {
alert('The token you provided is not valid.');
} else {
console.error(error);
}
});