简体   繁体   English

Restheart 验证器插件,用于在启动时加载 mongoRealmAuthenticator

[英]Restheart authenticator plugin for mongoRealmAuthenticator loading at startup

On windows, I am trying to switch to the recommended Mongo Realm Authenticator as suggested in the documentation, however, when setting up my restheart.yml file exactly as shown in the documentation I receive this error on startup:在 windows 上,我正在尝试按照文档中的建议切换到推荐的 Mongo Realm Authenticator,但是,当完全按照文档中所示设置我的 restheart.yml 文件时,我在启动时收到此错误:

"ERROR org.restheart.plugins.PluginsFactory - Error injecting dependency to AuthMechanism basicAuthMechanism: Authenticator mongoRealmAuthenticator not found" “错误 org.restheart.plugins.PluginsFactory - 将依赖项注入到 AuthMechanism basicAuthMechanism 时出错:未找到 Authenticator mongoRealmAuthenticator”

Here is the relevant section of my restheart.yml for reference.这是我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 version is 5.0, MongoDb version 4.2, Windows 10 Restheart 版本为 5.0,MongoDb 版本为 4.2,Windows 10

The simpleFileAuthenticator works correctly, it is only MongoRealmAuthenticator that causes problems when I try to use it as an authenticator for any auth-mechanism. simpleFileAuthenticator 工作正常,当我尝试将其用作任何身份验证机制的身份验证器时,只有 MongoRealmAuthenticator 会导致问题。

mongoRealmAuthenticator is available from RESTHeart 5.1 (see release notes here ). mongoRealmAuthenticator 可从 RESTHeart 5.1 获得(请参阅 此处的发行说明)。

Update to latest release to fix it.更新到最新版本以修复它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM