2

Hi I have a problem with elk reported below, I have to call an api in elk search, I generated the key for elk from the web but when I insert it in the rest call I have the error reported below, how do I fix it?

http://localhost:9200/_search

Api generate image: api

Curl endpoint:

curl --location --request GET 'http://localhost:9200/_search' \
--header 'Authorization: Bearer b0ZuTkZZUUJKTnlvaWhUSjdIX206MEo4UnA4RTBSMGFzOGYteE9iTDF1Zw=='

Response:

{
    "error": {
        "root_cause": [
            {
                "type": "security_exception",
                "reason": "unable to authenticate with provided credentials and anonymous access is not allowed for this request",
                "additional_unsuccessful_credentials": "oauth2 token: invalid token",
                "header": {
                    "WWW-Authenticate": [
                        "Basic realm=\"security\" charset=\"UTF-8\"",
                        "ApiKey"
                    ]
                }
            }
        ],
        "type": "security_exception",
        "reason": "unable to authenticate with provided credentials and anonymous access is not allowed for this request",
        "additional_unsuccessful_credentials": "oauth2 token: invalid token",
        "header": {
            "WWW-Authenticate": [
                "Basic realm=\"security\" charset=\"UTF-8\"",
                "ApiKey"
            ]
        }
    },
    "status": 401
}
Badger
  • 3,943
  • 2
  • 6
  • 17
riki
  • 1,502
  • 5
  • 17
  • 45

0 Answers0