在德鲁伊设置基本身份验证

时间:2018-06-15 11:56:25

标签: pivot-table olap druid

我想为Druid设置身份验证。我按照这个例子从http://druid.io/docs/latest/tutorials/quickstart.html

设置了德鲁伊

完成后,我按照此文档设置身份验证:http://druid.io/docs/latest/development/extensions-core/druid-basic-security.html

这些是common.runtime.properties文件中的以下更改

# Basic authentication
# Basic authentication: Authenticator settings
druid.auth.authenticatorChain=["MyBasicAuthenticator"]
druid.auth.authenticator.MyBasicAuthenticator.type=basic
druid.auth.authenticator.MyBasicAuthenticator.initialAdminPassword=password1
druid.auth.authenticator.MyBasicAuthenticator.initialInternalClientPassword=password2
druid.auth.authenticator.MyBasicAuthenticator.authorizerName=MyBasicAuthorizer


druid.auth.authorizers=["MyBasicAuthorizer"]
druid.auth.authorizer.MyBasicAuthorizer.type=basic

当我向网址发出POST请求时:http://localhost:8082/druid/v2/?pretty

身体:

{
  "queryType" : "topN",
  "dataSource" : "wikiticker",
  "intervals" : ["2015-09-12/2015-09-13"],
  "granularity" : "all",
  "dimension" : "page",
  "metric" : "edits",
  "threshold" : 25,
  "aggregations" : [
    {
      "type" : "longSum",
      "name" : "edits",
      "fieldName" : "count"
    }
  ]
}

用户名为:druid_system,密码为:password2

我收到以下错误:

io.druid.java.util.common.IAE: No authenticator found with prefix: [MyBasicAuthenticator]

有人对此有任何想法吗?

1 个答案:

答案 0 :(得分:0)

您的配置缺少escalator

添加以下内容:

# Escalator for the internal client that is used for the internal druid communication
druid.escalator.type=basic
druid.escalator.internalClientUsername=druid_system
druid.escalator.internalClientPassword=password2
druid.escalator.authorizerName=BasicAuthorizer