Not sure about this. In my experience, it's not very symmetrical.
The MessageDrivenContext has a getCallerPrincipal() method. I don't think there's a way to get the password.
You can set the username/password for connections using the outbound connection pool:
Put this in your
tibco-jms-ds.xml (or whatever you use)
This way your MDB doesn't have to know about passwords. I'm not sure this is what you want though.
Forget using getCallerPrincipal() ...