我想问是否有一个API,我可以使用ADAL SDK for Android和IOS来获取登录用户的租户名称(按其租户ID)
同样在B2B解决方案中,我可以获取外部租户ID的令牌(我受邀参加) 如果我有外部租户ID,可以得到它的名字吗?
答案 0 :(得分:0)
[我知道] AAD / ADFS令牌中没有声明您租户的String名称的声明。可以使用下面的displayName
字段从Microsoft图形(docs)中获得此信息。
GET https://graph.microsoft.com/v1.0/organization
HTTP/1.1 200 OK
Content-type: application/json
Content-length: 411
{
"assignedPlans": [
{
"assignedDateTime": "datetime-value",
"capabilityStatus": "capabilityStatus-value",
"service": "service-value",
"servicePlanId": "servicePlanId-value"
}
],
"businessPhones": [
"businessPhones-value"
],
"city": "city-value",
"country": "country-value",
"countryLetterCode": "countryLetterCode-value",
"displayName": "displayName-value" <-- This is your tenant name
}