How to connect to elasticsearch by providing Authorization token?

Answered
Dilip Singh asked on June 3, 2021

Hello,
Please see the requirement details below.

  1. I have an elasticsearch url (E.g: https://xxx.yyy.mm.abc:9200). I want to connect to that URL (node) by providing authorization token. Upon successful connect, I should be able to see the list of all index for that node. When select an index from the list, I should be able to see the data in pivot control.
  2. Also do we have APIs to customize "Connect to Elasticsearch" UI control (screen shot attached) in flexmonster? Like I may want to open this UI control from some other custom menu on my screen and provide the same functionality.

 
Please let me know for any query.

Attachments:
UI control.docx

2 answers

Public
Illia Yatsyshyn Illia Yatsyshyn Flexmonster June 4, 2021

Hello,

Thank you for posting on our forum.
 

  1. If your requirement is to use the default UI for choosing indices, we suggest customizing the Toolbar in order to complement the request with the desired credentials. Here is an example of how customization can be implemented: https://jsfiddle.net/flexmonster/327Lm90n/. You will need to overwrite the showConnectToElasticDialog function as well as the corresponding tab handler.
  2. You can open this pop-up programmatically by calling the flexmonster.toolbar.showConnectToElasticDialog({ "Authorization": token }) function. Please note that the customization mentioned in the previous paragraph is required to pass the authorization token as an argument.

 
Please let us know if it works for you.
 
Best regards,
Illia

Public
Dilip Singh June 7, 2021

Thank you! That's what I was looking for.

Please login or Register to Submit Answer