微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

带有JWT身份验证的Couchdb出现错误“ unknown_error:undef”,无法看到Fauxton

如何解决带有JWT身份验证的Couchdb出现错误“ unknown_error:undef”,无法看到Fauxton

这是配置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文件中的配置

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。