This is not possible, but there are options to work around. I think it would be best to use a single domain for authentication, specified as redirect_uri. On this redirect_uri you can add some query parameters, for example, your redirect_uri can be:
http://auth.domain.com/auth.php?tenant=tenant-1
Then, in the code for auth.php, you would grab this tenant parameter from the query string, authenticate the user, save his access token, and immediately redirect it back to tenant-1.domain.com
I'm not sure if this solution will be what you prefer, but it is currently not possible to specify subdomains for authentication, so this or a similar workaround is necessary.
Matthew johnston
source share