I have developed few mashup API (combining two or more KVStore into single API) for our app in python language. everything works perfectly fine but I have used hardcoded password to connect Splunk instance, here is my code snippet.
There is no way to connect Splunk service without username and password. for my specific requirement I have used setup page where I am storing the username and password and reading username password before connect method.
username, password = getUsernamePassword(sessionKey)
setup_entity = entity.getEntity('setup', 'manoj', namespace=appname, owner='nobody', sessionKey=sessionKey)
for each in setup_entity:
if each == 'username':
username = setup_entity[each]
elif each == 'password':
password = setup_entity[each]
return username, password