splunk-sdk-python icon indicating copy to clipboard operation
splunk-sdk-python copied to clipboard

Support Bearer Token

Open nkadri-code opened this issue 7 years ago • 3 comments

Splunk added the feature of creating and using Bearer Tokens for Rest API authentication. https://docs.splunk.com/Documentation/Splunk/7.3.0/Security/UseAuthTokens

Afaik, there is no possibility now to use Bearer token on the SDK

nkadri-code avatar Jul 16 '19 11:07 nkadri-code

Hey @nkadri-code, this is a newer feature added to Splunk Enterprise and we haven't scheduled this work yet for any of the Enterprise SDKs.

shakeelmohamed avatar Jul 16 '19 20:07 shakeelmohamed

Please review my PR #282

omerl13 avatar Oct 01 '19 15:10 omerl13

Hi @omerl13 , Thanks for PR #282 . @nkadri-code since the PR by @omerl13 has been merged ,Python SDK supports authentication using bearer token. Please use below code snippet for authenticating using bearer token,

import splunklib.client as client
service = client.connect(host='localhost',
                         splunkToken=<bearer-token>,
                         autologin=True)

akaila-splunk avatar Sep 03 '21 11:09 akaila-splunk