You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

获取FCM推送通知refresh token需使用什么OAuth授权scope?

解决方案

你需要替换原链接中scope参数的值为 https://www.googleapis.com/auth/firebase.messaging,这是Firebase Push Notification(Firebase云消息/FCM)对应的官方OAuth 2.0授权范围。

替换后完整授权链接示例

https://accounts.google.com/o/oauth2/auth?client_id=CLIENT_ID&scope=https://www.googleapis.com/auth/firebase.messaging&response_type=code&access_type=offline&redirect_uri=urn:ietf:wg:oauth:2.0:oob

额外注意事项

  • 你给出的POST请求参数里存在笔误:redirect_uri参数值少了一个冒号,正确值应为 urn:ietf:wg:oauth:2.0:oob,需要和授权链接里的redirect_uri完全一致,否则会触发参数不匹配的报错。
  • 后续通过refresh token换取access token、调用FCM推送接口时,均使用上述scope即可正常完成鉴权。

内容的提问来源于stack exchange,提问作者fgohil

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.10.02 09:48:04