Splunk Search

automated web interface login for kiosk

chanson
Engager

I am building a kiosk and before updating to 6.2 I was able to use the id and value tags for the web interface login. Now after updating there is no way to do this since the ids and values of the dom object are not really assigned. Instead the way it is done is through JavaScript calls. So my question is how to log into 6.2.0 web interface with automation. I know there is a way to use the insecure sign in to do this but I would rather avoid that.

wluijk
Loves-to-Learn

Is there no royal way to do this? I mean, can't you get access to the dashboards via the REST API just as with PowerBI where you can download a report? Or via a Javascript wrapper where you provide the credentials by your own app?

 

0 Karma

TobiasBoone
Communicator

I am assuming this is the same issue. I am able to populate the login form fine, but something about the encoding of the password being passed in must be mucked up because it errors on invalid password. Hand typing in the password works fine... Any other suggestions? As indicated above this is for a kiosk that must be unattended... and I don't want to expose the password in the url.

launch new IE instance

$ie = New-Object -ComObject InternetExplorer.Application
$ie.Visible = $true;

$ie.Fullscreen = $true;

$ie.navigate("https://mysever.domain.com:8000/en-US/account/logout#en-US/account/logout")
while ($ie.Busy -eq $true) { Start-Sleep -Seconds 1; }
Start-Sleep -Seconds 10

$ie.document.getElementById("username").value = "$spluser"
Start-Sleep -Seconds 3
$ie.document.getElementById("password").value = "$splpwd"
Start-Sleep -Seconds 3
$Link = $ie.Document.getElementsByTagName("input") | where-object {$_.type -eq "submit"}
$Link.click()

while ($ie.Busy -eq $true) { Start-Sleep -Seconds 1; } #wait for browser idle

0 Karma

jameswatts
Explorer

My solution to this issue was with the Chrome addon "Auto Logon" that stores the user ID and PW and will automagically log you in, with a few caveats; it may leave you on an undesirable "Login successful" or other page, and if the net or Splunk go away you're stuck on a 404 or other error page. Not cool for a keyboard-less digital signage box. Solution for that was to screenshot the page and compare the size to a "good" page's size; 404s are mostly white space as is the login screen. My script spawns a chrome browser in the BG and scrapes it's screen with "DISPLAY=:0 import -synchronize -window root test.png". If the test.png is less than 80 blocks I figure it's an error or login page; real pages start at about 100+ blocks usually. Mickey mouse, but it works. There's a slew of command line switches for chrome to customize it for kiosk use too. This can all be done with a Raspberry Pi too!!! Can't get much cheaper than that.

0 Karma

chanson
Engager

Hello James,

I ended up using a mix of AutoHotKey and powershell to solve my problem. Thank you for your reply. I implemented my solution on a Chrome box that was retrofitted with Win 8.1

0 Karma

jameswatts
Explorer

I'm allergic to windows, but that works too. ;^)

0 Karma
Get Updates on the Splunk Community!

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...