简体   繁体   中英

Credentials for reactivesearch in Elasticsearch 8.x

I want to use reactivesearch without any appbase.io , but with a self-hosted dockerized Elasticsearch.

Elasticsearch 8.x seems to have a new concept of authorization. I've installed ES and Kibana via docker regarding this security measures . Then, I created an API Key . I'm having no problems calling ES API with curl or Postman now, great!

But, regarding these reactivesearch docs , connecting my VueJS ReactiveSearch App directly with ES is done with these lines:

<template>
    <div id="app">
        <reactive-base
            url="https://localhost:9200"
            app="data1"
            credentials="Authorization:ApiKey <Hashed API Key>"
            enableAppbase="false"
        >
            <h1>Hello from ReactiveBase 👋</h1>
        </reactive-base>
    </div>
</template>

url should be my ES Cluster URL
app should be the index
credentials is unclear to me

As you see, I tried to put the API Authrorization in there. The documentation seems to suggest, that it should be "username:password". The app itself renders nothing and returns a blank page. So, no debugging possible.

Any ideas how to authorize ReactiveBase against a self-hosted docker ElasticSearch?

I ran into the same problem. What I worked out was that the credentials prop in the <ReactiveBase> component is not needed, and to manually set the Authorization in the headers prop:

headers={{
          Authorization: "Bearer private-asdasdfadfasdf123123"
}}

Also, it looks like you may have <reactive-base> incorrectly defined. What I have is <ReactiveBase> .

Ref: https://docs.appbase.io/docs/reactivesearch/v3/overview/reactivebase/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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