我尝试使用 POSTMAN 的 REST API 从 Elastic Search 中列出数据。
但我有“security_exception”
我从 https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-token.html 阅读了弹性文档
但不是工作。
我正在使用弹性 7.2
Method: POST
Content-type: Application/json
URI: http://xxx.xxx.xxx.xxx:9200/_security/oauth2/token
BODY:
{
"grant_type" : "password",
"username" : "user_name",
"password" : "correct_password"
}
我需要此服务返回身份验证 token 。但这是回应:
{
"error": {
"root_cause": [
{
"type": "security_exception",
"reason": "missing authentication credentials for REST request [/_security/oauth2/token]",
"header": {
"WWW-Authenticate": "Basic realm=\"security\" charset=\"UTF-8\""
}
}
],
"type": "security_exception",
"reason": "missing authentication credentials for REST request [/_security/oauth2/token]",
"header": {
"WWW-Authenticate": "Basic realm=\"security\" charset=\"UTF-8\""
}
},
"status": 401
}
最佳答案
关于rest - 如何使用 REST API 获取身份验证 token 或登录 Elastic Search?例如来自 postman ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57298636/