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

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

问题描述

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

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"}}

我从邮递员那里收到错误":权限被拒绝".我为谷歌的 web oauth2.0 客户端做了请求令牌,并取回了授权码令牌.

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.

我尝试在 URL 和标头中使用令牌,尝试使用 GET &POST 请求,但仍然被拒绝.

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

请帮忙.提前致谢

推荐答案

上面的答案对我不起作用.

The answers above did not work for me.

对我有用的是

Project Settings(左上角齿轮)-> Service Accounts(最右侧选项卡)-> Database Secrets(左侧菜单)-> 向下滚动,将鼠标悬停在项目符号上并点击显示

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

将此用作身份验证密钥,即 .../mycollection.json?auth=HERE

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

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

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