Just to recap.
Make sure you are getting the valid session key. Print it out. You could also test your code by substituting a connect by a static username/password combo temporarily
You might try changing your sessions to the following. Since you are getting the storage password list, app is going to be irrelvant.
service = client.connect(token=session_key)
Confirm what user context the knowledge object is running under (input/alert etc), I suspect that nobody or your session key is causing you the issue.
http://dev.splunk.com/view/python-sdk/SP-CAAAEJ6#currentuser
Ensure that user has the list_storage_passwords capability.
Use something like this to grab just the credential that matches the desired realm and username
retrievedCredential = [k for k in storage_passwords if k.content.get('realm')==realm and k.content.get('username')==username][0]
... View more