DCOS 1.7 身份验证失败,令牌无效。原因:数据不足

DCOS 1.7 authentication failure with Invalid token. Reason: not enough data

我们按照 "launch dc/os" 此处的说明 https://dcos.io/docs/1.7/administration/installing/cloud/aws/

使用云形成模板在 aws 中构建了 dcos 1.7 集群

我尝试使用 curl

运行 以下查询
curl --header " Authorization: token=xxxxx" https://{dcos-elb}/service/chronos/scheduler/jobs 

但得到了

<html>
<head>
<title>Unauthorized</title>
<noscript><meta http-equiv="refresh" content="5; url=/#/login"></noscript>
<script>
  (function () {
    var location = window.location;
    location.href = "/#/login?redirect=" + encodeURIComponent(location.href);
  }())
</script>
</head>
<body>
   <h1>Unauthorized</h1>
</body>
</html>

我按照这些说明获得了令牌 https://dcos.io/docs/1.7/administration/security/managing-authentication/#log-in-cli

即在浏览器中粘贴此 url: https:///login?redirect_uri=urn:ietf:wg:oauth:2.0:oob,使用 google creds 登录,然后复制令牌

主节点中的 adminrouter 日志有以下几行

[notice] 31915#0: *8026 [lua] auth.lua:119: validate_jwt_or_exit(): Invalid token. Reason: not enough data, client: xx.xx.xx.xx, server: dcos.*, request: "GET /service/chronos/scheduler/jobs HTTP/1.1", host: "xxxxx"

我该如何解决这个问题?。我是否必须在 curl 查询中包含任何额外的有效负载?

如有任何建议,我们将不胜感激。谢谢

首先,dcos config show 并检查 core.dcos_url 的变量值,确保您点击的是 "HTTP" 和 NOT "HTTPS".

要进行更改,请按照以下步骤操作,

1:) dcos config unset core.dcos_url

2:) dcos config set core.dcos_url <CLuster_URL_Only_HTTP>

3:) 终于可以了,dcos auth login

4:) 步骤 (3) 将 return URL,您必须将其粘贴到浏览器中并获取令牌并将其粘贴到 Cli 上,它正在等待令牌。