问题描述
这是配置local.ini文件
[jwt_auth]
required_claims = sub
[jwt_keys]
hmac:_default = aGVsbG8=
[chttpd]
authentication_handlers = {couch_httpd_auth,cookie_authentication_handler},{couch_httpd_auth,default_authentication_handler},{chttpd_auth,jwt_authentication_handler}
当我尝试访问http:// localhost:5984时,出现以下错误
{"error":"unkNown_error","reason":"undef","ref":6776463}
我可以在控制台中看到以下日志
[error] 2020-09-20T14:37:04.994313Z nonode@nohost <0.506.0> 8bbcfe9007 req_err(6776463) unkNown_error : undef
[<<"chttpd_auth:jwt_authentication_handler/1">>,<<"chttpd:authenticate_request/2 L531">>,<<"chttpd:process_request/1 L303">>,<<"chttpd:handle_request_int/1 L243">>,<<"mochiweb_http:headers/6 L150">>,<<"proc_lib:init_p_do_apply/3 L247">>]
更多信息:
a:在docker上运行
b:沙发版本3.0
我错过了任何配置吗?或者我们有什么值得参考的地方。
解决方法
版本沙发数据库版本有问题
更新到3.1.1
[jwt_auth]
required_claims = exp
[jwt_keys]
hmac:_default = aGVsbG8=
[chttpd]
authentication_handlers = {chttpd_auth,jwt_authentication_handler},{chttpd_auth,cookie_authentication_handler},default_authentication_handler}
这些是.ini文件中的配置