I do something similar with LoadCredential and it is quite amazing, especially when you want to run the application as a dynamic user.