使用邮递员访问Firebase REST API [英] using postman to access firebase REST API

查看:208
本文介绍了使用邮递员访问Firebase REST API的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用邮递员对Firebase进行REST API调用。当我的安全规则允许所有用户(包括未经授权的用户)使用时,我已经设法从firebase中读取数据。



但是当我使用这个规则:

  {rules:{。read:auth!= null,.write:auth!= null}} 

我得到'错误':邮递员'拒绝'权限。
我为google的web oauth2.0客户端请求了令牌,并且获得了授权代码令牌。

我试图在URL和头文件中使用令牌,试着用GET& POST请求,仍然被拒绝。



请帮忙。
在此先感谢

解决方案

上面的答案对我来说不起作用。 b $ b

为我工作的是

项目设置(左上角的齿轮) - > 帐户(最右边的选项卡) - > 数据库秘密(左侧菜单) - >向下滚动,将鼠标悬停在圆心上,然后点击显示
$ b

使用此作为授权密钥,即 ... / mycollection.json?auth = HERE


I'm trying to use postman to do REST API calls to firebase. I've managed to read from firebase when my security rule is to permit all users including unauthorized ones.

but when I use this rule :

{"rules":{".read": "auth != null", ".write": "auth != null"}}

I get 'error' : 'permission denied' from postman. I did the request token for google's web oauth2.0 client and got the authorization_code token back.

I tried to use token in the URL and in the header, tried it with GET & POST request and still get denied.

please help. Thanks in advance

解决方案

The answers above did not work for me.

What did work for me was going to

Project Settings (top left corner gear) -> Service Accounts (far right tab) -> Database Secrets (left menu) -> Scroll down, hover over the bulltets and click Show

Use this as the auth key, i.e. .../mycollection.json?auth=HERE

这篇关于使用邮递员访问Firebase REST API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆