added support for multiple domains and additional oauth scopes