【发布时间】:2020-10-15 21:27:35
【问题描述】:
我是弹性搜索的新手。通过 Java High Level Rest Client 将我的 Spring boot 应用程序与 Elastic search 集成,并且在设置证书和密码后,我通过提供以下属性来启用安全性:
xpack.security.enabled: true
xpack.security.transport.ssl.enabled: true
xpack.security.transport.ssl.verification_mode: certificate
xpack.security.transport.ssl.keystore.path: elastic-certificates.p12
xpack.security.transport.ssl.truststore.path: elastic-certificates.p12
xpack.security.http.ssl.enabled: true
xpack.security.http.ssl.keystore.path: "http.p12"
我也在 kibana.yaml 中完成了所需的更改,并且可以访问它。 通过 Kibana 尝试以下调用以获取 OAuth 令牌:
POST /_security/oauth2/token
{
"grant_type" : "password",
"username" : "elastic",
"password" : "password_for_elastic_super_user"
}
在 kibana 中执行后出现以下错误:
{
"error" : {
"root_cause" : [
{
"type" : "security_exception",
"reason" : "current license is non-compliant for [security tokens]",
"license.expired.feature" : "security tokens"
}
],
"type" : "security_exception",
"reason" : "current license is non-compliant for [security tokens]",
"license.expired.feature" : "security tokens"
},
"status" : 403
}
我也打了GET license API,得到以下回复:
{
"license" : {
"status" : "active",
"uid" : "62b089de-422e-41f0-88c8-9ad76b27cd62",
"type" : "basic",
"issue_date" : "2020-06-25T07:17:48.310Z",
"issue_date_in_millis" : 1593069468310,
"max_nodes" : 1000,
"issued_to" : "elasticsearch",
"issuer" : "elasticsearch",
"start_date_in_millis" : -1
}
}
谁能帮忙解决这个问题?
【问题讨论】:
-
尝试通过邮递员调用一次。添加基本身份验证。请在正文中传递
grant_type。
标签: java spring-boot elasticsearch oauth-2.0 kibana