firebase-tools - “无法解析授权令牌” [英] firebase-tools -- "Could not parse auth token"

查看:141
本文介绍了firebase-tools - “无法解析授权令牌”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否有人可以看到我正在做的事情,运行firebase cli jode.js工具显然是错误的。我已经尝试了一些令牌(一些由登录产生的:ci和一些由正常登录产生的),都无济于事。看来有些命令正在工作(列表,初始化),但我不能得到data:get命令工作。这似乎是--token选项的问题:如果我正常登录(firebase登录),我可以执行data:get / -f rentette命令没有任何问题。 b
$ b

任何帮助都会非常感谢!!



(下面是失败命令的输出)。
$ b

  [〜/ $] firebase --token-XXXXXjzTKnX9c_7qO | 9546a9bc98f70f0b5b55ceb08ca23156list 
┌─────────── ─────────────────────────────────
│名称│计划│合作者│
├─────────────────────────┼────────────────────────────┤ b $ b│rentette│免费│nick@xxxxx.net│
├────────────────────────────────── ───────────────┤

[〜/ $] firebase --to ken-XXXXXjzTKnX9c_7qO | YYYYYYYYYYYYYYYY5ceb08ca23156data:get / -f rentette --debug
----------------------------- -----------------------------------------
命令:/ usr / bin / node /home/nhamilton/.npm-packages/bin/firebase --token -XXXXXjzTKnX9c_7qO | YYYYYYYYYYYYYYYY5ceb08ca23156 data:get / -f rentette --debug
平台:linux
Node版本:v5.10.1
时间:星期五Apr 15 2016 11:31:20 GMT + 1000(AEST)
------------------------- ---------------------------------------------

错误:无法解析授权令牌。
错误上下文:{
body:{
error:无法解析授权令牌。

response:{
statusCode:400,
headers:{
content-length:46,
content-type:application / json; charset = utf-8,
cache-control:no-cache,
strict-transport-security:max
uri:{
;
b $ b,
协议:https:,
slashes:true,
auth:null,
host:rentette.firebaseio.com,
port :443,
hostname:rentette.firebaseio.com,
hash:null,
search:?auth = -XXXXXjzTKnX9c_7qO%7cYYYYYYYYYYYYYY5ceb08ca23156,
query:auth = -XXXXXjzTKnX9c_7qO%7cYYYYYYYYYYYYYY5ceb08ca23156,
pathname:/.json,
path:/.json?auth=-XXXXXjzTKnX9c_7qO%7cYYYYYYYYYYYYYY5ceb08ca23156,
href:https://rentette.firebaseio.com/.json?auth=-XXXXXjzTKnX9c_7q O%7cYYYYYYYYYYYYYY5ceb08ca23156

method:GET,
headers:{}
}
}
}


解决方案

我可以知道你的令牌从哪里来?如果您仍然使用旧版Firebase身份验证令牌,请更新您的令牌。因为我们现在更新了Firebase身份验证SDK,所以旧的令牌应该由新的身份验证SDK生成,否则将无法在新的Firebase上使用。

I was wondering if someone could see if there is anything that I am doing that is obviously wrong with running the firebase cli jode.js tool. I've tried a few tokens (some generated by the login:ci and some generated by a normal login), all to no avail. It seems that some commands are working (list, init), but I cannot get the data:get command to work. This seems to be a problem with the "--token" option: if I login normally ("firebase login") I am able to execute the "data:get / -f rentette" command without any problem.

Any help would be much appreciated!!

(Below is the output of the failing command).

[~/$] firebase --token "-XXXXXjzTKnX9c_7qO|9546a9bc98f70f0b5b55ceb08ca23156" list
┌──────────────────┬──────┬────────────────────┐
│ Name             │ Plan │ Collaborators      │
├──────────────────┼──────┼────────────────────┤
│ rentette         │ Free │ nick@xxxxx.net │
├──────────────────┼──────┼────────────────────┤

[~/$] firebase --token "-XXXXXjzTKnX9c_7qO|YYYYYYYYYYYYYYYY5ceb08ca23156" data:get / -f rentette --debug
----------------------------------------------------------------------
Command:      /usr/bin/node /home/nhamilton/.npm-packages/bin/firebase --token -XXXXXjzTKnX9c_7qO|YYYYYYYYYYYYYYYY5ceb08ca23156 data:get / -f rentette --debug
Platform:     linux
Node Version: v5.10.1
Time:         Fri Apr 15 2016 11:31:20 GMT+1000 (AEST)
----------------------------------------------------------------------

Error: Could not parse auth token.
Error Context: {
  "body": {
    "error": "Could not parse auth token."
  },
  "response": {
    "statusCode": 400,
    "headers": {
      "content-length": "46",
      "content-type": "application/json; charset=utf-8",
      "cache-control": "no-cache",
      "strict-transport-security": "max-age=31556926; includeSubDomains; preload",
      "connection": "close"
    },
    "request": {
      "uri": {
        "protocol": "https:",
        "slashes": true,
        "auth": null,
        "host": "rentette.firebaseio.com",
        "port": 443,
        "hostname": "rentette.firebaseio.com",
        "hash": null,
        "search": "?auth=-XXXXXjzTKnX9c_7qO%7cYYYYYYYYYYYYYY5ceb08ca23156",
        "query": "auth=-XXXXXjzTKnX9c_7qO%7cYYYYYYYYYYYYYY5ceb08ca23156",
        "pathname": "/.json",
        "path": "/.json?auth=-XXXXXjzTKnX9c_7qO%7cYYYYYYYYYYYYYY5ceb08ca23156",
        "href": "https://rentette.firebaseio.com/.json?auth=-XXXXXjzTKnX9c_7qO%7cYYYYYYYYYYYYYY5ceb08ca23156"
      },
      "method": "GET",
      "headers": {}
    }
  }
}

解决方案

May I know that where is your token coming from? If you still use legacy firebase authentication token, please update your token. Cause right now we updated firebase auth SDK, so the old token should be generated by the new auth SDK, otherwise it won't work on new Firebase.

这篇关于firebase-tools - “无法解析授权令牌”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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