Developing Dashboards, Views, and Apps for Splunk Web

 


Authentication Endpoint

This documentation does not apply to the most recent version of Splunk. Click here for the latest version.

Contents

Authentication Endpoint

Use the authentication endpoint at /services/auth/ to authenticate any of your HTTP requests. Currently, the only endpoint available through auth is login.


Login

Provides a login interface for user authentication.


POST

Returns a session key to use when making REST calls to splunkd.


FormArguments
usernameThe Splunk account username.
passwordThe corresponding password.

Response

ResponseStatus
200User successfully authenticated.
400Username or password not provided.
401Login credentials failed.

Examples

curl


Sample curl request for a session ID:


curl -k 'https://localhost:8089/services/auth/login' -d"username=admin&password=changeme"
<response>
<sessionKey>aeae5bd9521f714eddebb6dcb989f25e</sessionKey>

This generates a session ID you can use for any other requests.


Save your session ID:


export SPLUNK_AUTH_TOKEN=`curl -k $SPLUNK_URL/auth/login -d"username=admin&password=changeme" 2>/dev/null | grep sessionKey | sed s@'.*<sessionKey>\(.*\)</sessionKey>'@'\1'@`

This saves your session ID to SPLUNK_AUTH_TOKEN.


wget


The following example uses wget and outputs the session ID to a file called testme.


wget -O testme --no-check-certificate --post-data="username=admin&password=changeme" "localhost:8089/services/auth/login"

This documentation applies to the following versions of Splunk: 3.3 , 3.3.1 , 3.3.2 , 3.3.3 , 3.3.4 , 3.4 , 3.4.1 , 3.4.2 , 3.4.3 , 3.4.5 , 3.4.6 , 3.4.8 , 3.4.9 , 3.4.10 , 3.4.11 , 3.4.12 , 3.4.13 , 3.4.14 View the Article History for its revisions.


You must be logged into splunk.com in order to post comments. Log in now.

Was this documentation topic helpful?

If you'd like to hear back from us, please provide your email address:

We'd love to hear what you think about this topic or the documentation as a whole. Feedback you enter here will be delivered to the documentation team.