【发布时间】:2021-04-01 18:29:33
【问题描述】:
我一直在尝试将 CouchDB 中的 JWT 身份验证方法与 Auth0 一起使用。按照 https://docs.couchdb.org/en/stable/api/server/authn.html#jwt-authentication 的文档,我在我的 default.ini 文件中添加了 authentication_handlers 并像这样配置了 jwt_auth 和 jwt_keys:
[jwt_auth]
; List of claims to validate
required_claims = alg,kid,sub
[jwt_keys]
rsa:<kid> = -----BEGIN PUBLIC KEY-----\n
<PublicKey>
\n-----END PUBLIC KEY-----\n
我从 Auth0 (https://[myDomain]/.well-known/jwks.json) 获得了孩子和公钥。现在,当我请求 JWT 令牌并将其添加到针对 _session 端点的 CouchDB 请求时,我得到以下响应:
{
"ok": true,
"userCtx": {
"name": null,
"roles": []
},
"info": {
"authentication_handlers": [
"cookie",
"default"
]
}
}
我觉得我在 default.ini 文件中做错了什么。谁能帮帮我?
【问题讨论】: