Added a way to check the creds to see if its is an object or a location and handles it accordingly.

This method does things I wasn't expecting.  E.g. it validates all the input, and also returns some of it as a new object.  Instead, could it validate and return a single object that contains all the sanitized input?  E.g. you pass in the user-given parameters and get back an object with the creds, appId, tag, etc.