2020-11-29T18:57:16.191Z - warn app { JsonWebTokenError: jwt must be provided at Object.module.exports [as verify] (/usr/local/lib/node_modules/cncjs/node_modules/jsonwebtoken/verify.js:53:17) at _callee2$ (/usr/local/lib/node_modules/cncjs/dist/cncjs/server/index.js:4273:77) at tryCatch (/usr/local/lib/node_modules/cncjs/node_modules/regenerator-runtime/runtime.js:63:40) at Generator.invoke [as _invoke] (/usr/local/lib/node_modules/cncjs/node_modules/regenerator-runtime/runtime.js:293:22) at Generator.next (/usr/local/lib/node_modules/cncjs/node_modules/regenerator-runtime/runtime.js:118:21) at asyncGeneratorStep (/usr/local/lib/node_modules/cncjs/dist/cncjs/server/index.js:4022:103) at _next (/usr/local/lib/node_modules/cncjs/dist/cncjs/server/index.js:4024:194) at /usr/local/lib/node_modules/cncjs/dist/cncjs/server/index.js:4024:364 at new Promise (<anonymous>) at /usr/local/lib/node_modules/cncjs/dist/cncjs/server/index.js:4024:97 at /usr/local/lib/node_modules/cncjs/dist/cncjs/server/index.js:4310:22 at Layer.handle_error (/usr/local/lib/node_modules/cncjs/node_modules/express/lib/router/layer.js:71:5) at trim_prefix (/usr/local/lib/node_modules/cncjs/node_modules/express/lib/router/index.js:315:13) at /usr/local/lib/node_modules/cncjs/node_modules/express/lib/router/index.js:284:7 at Function.process_params (/usr/local/lib/node_modules/cncjs/node_modules/express/lib/router/index.js:335:12) at next (/usr/local/lib/node_modules/cncjs/node_modules/express/lib/router/index.js:275:10) name: 'JsonWebTokenError', message: 'jwt must be provided' } 2020-11-29T18:57:16.202Z - warn app Forbidden: ipaddr=192.168.1.xxx, code="credentials_required", message="No authorization token was found"
描述
无法使用 URL http://192.168.1.xxx/api/signin访问 CNCJS 中的 API 系统。
它一直在说 401 或 403,具体取决于 API 尝试查询的内容,并且用户是在settings->user-accounts中分配的,如果没有定义用户,我可以访问 /api/signin 但不能做任何进一步的事情-更多API 系统是否有适当的文档,或者如何访问https://github.com/cncjs/cncjs/wiki/Server-API#authorized-access-only-endpoints。
我尝试在对 CNCJS 服务器的发布请求中使用以下字符串:
{"enabled":true,"token":"token-was-here","name":"user-was-here"}
和
{ enabled: true, token: <JWT>, name, <name> }
我使用的工具是 Firefox 上的 RESTClient。
2020-11-29T18:57:16.191Z - warn app { JsonWebTokenError: jwt must be provided at Object.module.exports [as verify] (/usr/local/lib/node_modules/cncjs/node_modules/jsonwebtoken/verify.js:53:17) at _callee2$ (/usr/local/lib/node_modules/cncjs/dist/cncjs/server/index.js:4273:77) at tryCatch (/usr/local/lib/node_modules/cncjs/node_modules/regenerator-runtime/runtime.js:63:40) at Generator.invoke [as _invoke] (/usr/local/lib/node_modules/cncjs/node_modules/regenerator-runtime/runtime.js:293:22) at Generator.next (/usr/local/lib/node_modules/cncjs/node_modules/regenerator-runtime/runtime.js:118:21) at asyncGeneratorStep (/usr/local/lib/node_modules/cncjs/dist/cncjs/server/index.js:4022:103) at _next (/usr/local/lib/node_modules/cncjs/dist/cncjs/server/index.js:4024:194) at /usr/local/lib/node_modules/cncjs/dist/cncjs/server/index.js:4024:364 at new Promise (<anonymous>) at /usr/local/lib/node_modules/cncjs/dist/cncjs/server/index.js:4024:97 at /usr/local/lib/node_modules/cncjs/dist/cncjs/server/index.js:4310:22 at Layer.handle_error (/usr/local/lib/node_modules/cncjs/node_modules/express/lib/router/layer.js:71:5) at trim_prefix (/usr/local/lib/node_modules/cncjs/node_modules/express/lib/router/index.js:315:13) at /usr/local/lib/node_modules/cncjs/node_modules/express/lib/router/index.js:284:7 at Function.process_params (/usr/local/lib/node_modules/cncjs/node_modules/express/lib/router/index.js:335:12) at next (/usr/local/lib/node_modules/cncjs/node_modules/express/lib/router/index.js:275:10) name: 'JsonWebTokenError', message: 'jwt must be provided' } 2020-11-29T18:57:16.202Z - warn app Forbidden: ipaddr=192.168.1.xxx, code="credentials_required", message="No authorization token was found"
版本
你如何安装CNCjs?
数控系统
硬件
操作系统