[英]Error while executing get request firebase, error: 'Unauthorized request in Angular
database in firebase firebase 中的数据库
this is where im calling api url这是我打电话给 api url 的地方
i am trying to fetch data from firebase api in angular but facing 'Unauthorized request error, i tried for post req as well, tried in another service and component as well but it still the same.
我正在尝试从 angular 中的 firebase api 中获取数据,但遇到“未经授权的请求错误”,我也尝试了 post req,也尝试了另一个服务和组件,但它仍然相同。 i simply added one json file to firebase and trying to fetch in my project.
我只是将一个 json 文件添加到 firebase 并尝试在我的项目中获取。
Navigate to your Firebase console, and copy your project Firebase Config.导航到您的 Firebase 控制台,并复制您的项目 Firebase Config。 Then pass it to the initializeApp method.
然后将其传递给 initializeApp 方法。 For example, this implementation shows Google Auth:
例如,此实现显示 Google Auth:
const app = initializeApp(firebaseConfig);
const auth = getAuth(app);
useDeviceLanguage(auth);
const provider = new GoogleAuthProvider();
const R = await signInWithPopup(auth, provider);
To find your Firebase Config, go to thislink , then select your project.要找到您的 Firebase 配置,go 到此链接,然后 select 您的项目。 Now go to the bottom (your apps section), select the config option from the SDK setup and configuration menu, and copy it.
现在 go 到底部(您的应用程序部分),select SDK 设置和配置菜单中的配置选项,然后复制它。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.