I have developed an MVC application enabled single sign on with Office 365. I want retrieve SharePoint tenant URL after logged in.
Example: Suppose I have logged in with
firstname.lastname@example.org. I can build the SharePoint tenant URL with by taking
contoso name from the user principal and building the URL like
This is working fine however if multi domain exist in single tenant I am unable to retrieve the URL when other domain user logged in
email@example.com my SharePoint tenant URL building like
https://domain2-admin.sharepoint.com but SharePoint tenant url same like
Thanks in advance.