Documentation: 3.2.2
Print Version Contents
This page last updated: 04/16/08 11:04am

Authentication methods

There are 3 methods of authenticating with the splunkd HTTP server.

Authentication is the process of validating the identity of the requesting client. Authorization can only occur after authentication, and refers to the process of granting permission to the requesting client for performing a certain action. (Unfortunately, the HTTP standard named its authentication header incorrectly.)

All requests return an HTTP 401 code if the credentials are invalid. An HTTP 403 is returned if the credentials are valid but the request was denied because of insufficient privileges.

HTTP Header

splunkd supports token-based authentication via the standard HTTP Authorization header. This is the recommended method for most programmatic accesses against the API.

1. Obtain a session key via the /services/auth/login endpoint, for example 71e2f3553ba1dd279e36a6920a1e7840
2. Insert the session key into the Authorization header of every subsequent request, as follows:

Authorization: Splunk 71e2f3553ba1dd279e36a6920a1e7840

HTTP digest

splunkd supports HTTP digest authentication, as defined by RFC 2617. This is the method that is invoked when you browse the HTTP server from a web browser. Most modern HTTP clients support digest authentication natively.

Old school

This is the older style of authentication used by Splunk versions 1.0 through 3.1. This method is only used for legacy applications, or instances where LDAP is the primary means of authentication.

1. Obtain the authStr generated by the older userLogin invokeAPI call. The string is an XML fragment that contains three key nodes: userId, username, and authToken.
2. Append those three values to the final request URI. For example, if you are requesting

https://localhost:8089/services/search/jobs

then the final URI would be:

https://localhost:8089/services/search/jobs?userId=1&username=admin&authToken=135932556

Previous: Splunk's REST API    |    Next: Login

Comments

No comments have been submitted.

Log in to comment.