glutton icon indicating copy to clipboard operation
glutton copied to clipboard

Support basic access authentication

Open xdtianyu opened this issue 9 years ago • 8 comments

在有 HTTP authentication 的情况下不能正常工作。

build.js:8 POST https://www.example.com/jsonrpc 401 (Unauthorized)i @ build.js:8t.default.methods.testConnection @ build.js:8(anonymous function) @ build.js:20t.default.methods.connectToServer @ build.js:8(anonymous function) @ build.js:20t.default.events.connectToServer @ build.js:8e.$emit @ build.js:21e.$dispatch @ build.js:21t.default.methods.connect @ build.js:8(anonymous function) @ build.js:20
Navigated to https://www.example.com/glutton/

应该是因为 rcp.call 时没有带上 Authorization:Basic xxxxxxxxxxxxxx 头信息

xdtianyu avatar Apr 12 '16 11:04 xdtianyu

是的,请看 README.mdrpc-userrpc-passwd 没有被支持。

NemoAlex avatar Apr 12 '16 12:04 NemoAlex

不是说 aria2 的认证,是 http 服务器的认证。aria2c 已使用 SECRET TOKEN,外层的 nginx 代理还有一层 HTTP Basic Authentication

xdtianyu avatar Apr 12 '16 12:04 xdtianyu

nginx 配置了 https://www.example.com/jsonrpc 需要 Authentication

nginx 配置

    # aria2 jsonrpc
    location /jsonrpc {
        auth_basic "Authentication required";
        auth_basic_user_file /etc/nginx/.dlpasswd;
        proxy_pass        http://127.0.0.1:6800;

        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header Host $host;
    }

xdtianyu avatar Apr 12 '16 12:04 xdtianyu

...明白了 感觉好多余啊,能别这么用不

NemoAlex avatar Apr 12 '16 12:04 NemoAlex

Glutton 使用了 Fetch API,目前的标准是不支持 Basic access authentication 的,要改起来比较麻烦。 这也是不想支持 rpc-userrpc-passwd 的原因。

NemoAlex avatar Apr 12 '16 12:04 NemoAlex

webui-aria2yaaw (ajax) 都可以正常工作的,没有这一层心里不踏实。

xdtianyu avatar Apr 12 '16 12:04 xdtianyu

@NemoAlex 可以使用 fetch('http://user:[email protected]/jsonrpc') 这种方式试试

ccbikai avatar Jun 18 '16 02:06 ccbikai

不用这么麻烦 可以用aria2自带证书功能

ghost avatar Sep 24 '16 21:09 ghost