启动时加载mongoRealmAuthenticator的Restheart authenticator插件



在windows上,我正试图按照文档中的建议切换到推荐的Mongo Realm Authenticator,然而,当按照文档中所示设置我的restheart.yml文件时,我在启动时收到了这个错误:

"错误org.resteart.plugins.PluginsFactory-将依赖项注入到AuthMechanism basicAuthMechanic:找不到Authenticator mongoRealmAuthenticator时出错">

这是我的restheart.yml的相关部分供参考。

auth-mechanisms:
tokenBasicAuthMechanism:
enabled: true
basicAuthMechanism:
enabled: true
authenticator: mongoRealmAuthenticator
digestAuthMechanism:
enabled: false
realm: RESTHeart Realm
domain: localhost
authenticator: simpleFileAuthenticator
identityAuthMechanism:
enabled: false
username: admin
roles:
- admin
- user
authenticators:
mongoRealmAuthenticator:
users-db: restheart
users-collection: users
prop-id: _id
prop-password: password
json-path-roles: $.roles
bcrypt-hashed-password: true
bcrypt-complexity: 12
create-user: true
create-user-document: '{"_id": "admin", "password": "$2a$12$lZiMMNJ6pkyg4uq/I1cF5uxzUbU25aXHtg7W7sD2ED7DG1wzUoo6u", "roles": ["admin"]}'
# create-user-document.password must be hashed when bcrypt-hashed-password=true
# default password is 'secret'
# see https://bcrypt-generator.com but replace initial '$2y' with '$2a'
cache-enabled: false
cache-size: 1000
cache-ttl: 60000
cache-expire-policy: AFTER_WRITE
simpleFileAuthenticator:
enabled: true
conf-file: {{{users-conf-file}}}

Restheart版本为5.0,MongoDb版本为4.2,Windows 10

simpleFileAuthenticator工作正常,当我尝试将其用作任何身份验证机制的身份验证程序时,只有MongoRealmAuthenticator会导致问题。

mongoRealmAuthenticator可从RESTHeart 5.1获得(请参阅此处的发行说明(。

更新到最新版本以修复它。

最新更新