Dashboards & Visualizations

web session ID usable for rest session?

devsplunkid
New Member

is is possible to use Splunk's web session ID to authenticate a REST API call in a custom REST service?

Tags (1)
0 Karma

harsmarvania57
SplunkTrust
SplunkTrust

Hi,

Here I am assuming that Custom REST is on Splunk Instance only and If your custom rest service is exposed to Splunk Web then yes you can use SplunkWeb CSRF Token for custom rest authentication.

For example:
I have dashboard which is using Javascript and hitting custom rest service in same Splunk instance and that custom rest is exposed to Splunk Web.

So in Javascript

xhr.setRequestHeader('X-Splunk-Form-Key', document.cookie.match(/splunkweb_csrf_token_8000=(\d+)/)[1]);

and custom rest which is exposed to Splunk Web is accessible at /en-US/splunkd/__raw/services/my_custom_rest

0 Karma
Get Updates on the Splunk Community!

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...

Tech Talk | Elevating Digital Service Excellence: The Synergy of Splunk RUM & APM

Elevating Digital Service Excellence: The Synergy of Real User Monitoring and Application Performance ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...