I need to find out the name of the tenant user, since the service endpoint, resourceId, that I will use the Azure service, which requires me to specify the tenant name:
service endpoint: https: // [tenantnamme] .api.crm.dynamics.com / ...
Resource ID: https: // [tenantname] .crm.dynamics.com
I was hoping the Unified Microsoft Graph API would find this for me. I looked at the documentation, the closest I see is to use graph.microsoft.com/v1.0/organization which will return me: verifiedDomains: [.... "name": "contoso.onmicrosoft.com"]
But I'm not sure if this is the right approach. What if org has several verified domains? Verified domain name matches tenant name?
Update: This is my real scenario. I have a web application that allows a user to authenticate to Azure AD through OAuth2. I have no problem getting the update token and access token from OAuth interaction. However, in other cases, to use another service, this requires [azure-ad-tenant-name] at the service endpoint. This is my question.
source
share