Dashboards & Visualizations

Retrieving Username/Password with Javascript

rabauer
New Member

Hey all,

I'm working on a way to link from a view on one searchhead to a view on another searchhead, without having to log in to the second one. Currently the link is working as follows: A link in a view created using StaticContentSample links to another view in the same searchhead, which uses ServerSideInclude to include an html page* which automatically submits a login form to the other searchhead, and so the user is redirected to that machine. All that is great, however, currently the credentials for the second searchhead are hardcoded into the Javascript on that page*, which is not ideal for our application.

The credentials for both machines are the same, so I was wondering if there was a way I could retrieve the username and password of the currently logged in user, so I could send those credentials to the other searchhead.

I would like do this with only Javascript, but could potentially use other languages (Python, PHP, Java, ..)

Thanks in advance for any help!

* - same page

0 Karma

ineeman
Splunk Employee
Splunk Employee

Unfortunately, I don't think there is a way to do what you want. If this were the same search head you could reuse your authentication token, but since they are different, that won't work.

One possibility is to use the storage/passwords endpoint to store the credentials for the other search heads, such that you can access them programmatically.

0 Karma
Get Updates on the Splunk Community!

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...