简体   繁体   English

Microsoft Azure AD图形API,如何在节点js中使用botbuilder版本4获取响应的用户邮件?

[英]Microsoft Azure AD graph API, How to get the user mail in response with botbuilder version 4 in node js?

I had created a Azure active directory v1 in azure for the OAuth connection settings to the bot. 我已经为Azure的机器人的OAuth连接设置创建了一个Azure活动目录v1。 I got the user's access token successfully, then I make call to GET https://graph.microsoft.com/v1.0/me with an Authorization: Bearer header. 我成功获取了用户的访问令牌,然后使用Authorization:Bearer标头调用GET https://graph.microsoft.com/v1.0/me

{
   "@odata.context": 
   "https://graph.microsoft.com/v1.0/$metadata#users/$entity",
   "businessPhones": [],
   "displayName": "Ram kumar",
   "givenName": "kumaran raju",
   "jobTitle": null,
   "mail": null,
   "mobilePhone": null,
   "officeLocation": null,
   "preferredLanguage": null,
   "surname": "10sa788ad8df-457kdj9dsfs-78d7a8df6a6-7d7a887df7a9",
   "userPrincipalName": "something",
   "id": "4532523589023895"
}

The above response which I got from that API. 我从该API获得的上述响应。 But I need to access the user's mail property, which gives only null . 但是我需要访问用户的mail属性,该属性仅提供null So, how I get the logged in user's mail from this response? 那么,如何从该响应中获取登录用户的邮件

It means the user does not have the mail property. 这意味着用户不具有mail属性。 The mail is read-only which is the SMTP address for the user. mail是只读的,是用户的SMTP地址。 It is tied to Exchange Online, you could not write to that attribute unless you have an Exchange Online license, when you activate a license for the user, Exchange Online will update the field with the correct mailbox mail address during the creation of the user's mailbox. 它与Exchange Online绑定,除非拥有Exchange Online许可证,否则您无法写入该属性,当为用户激活许可证时,Exchange Online将在创建用户邮箱时使用正确的邮箱邮件地址更新该字段。 。

For more details, you could refer to this link . 有关更多详细信息,您可以参考此链接

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用 microsoft graph api 获取 azure 广告用户属性 - How to get azure ad user properties using microsoft graph api 如何使用microsoft graph api为azure ad中的用户分配角色 - How to use microsoft graph api for assigning role to the user in azure ad 是否可以通过Azure AD Graph API或Microsoft Graph API在租户中获取所有用户信息? - Is it possible to get all the user informations in a tenant by Azure AD Graph API or Microsoft Graph API? 如何发布Azure AD Graph API或Microsoft Graph API中的更新 - How updates in Azure AD Graph API or Microsoft Graph API are released 使用 Microsoft Graph 如何获取从本地 AD 同步的 Azure AD 用户字段 - Using Microsoft Graph how do i get Azure AD user fields that were synced from On Premise AD 如何使用 Microsoft Graph API 在 Azure AD 中显示用户资源类型的管理器 - How to use Microsoft Graph API to display manager of a user resource type in Azure AD Microsoft-Graph - 作为 Azure AD 管理员如何为其他用户获取有效的 access_token - Microsoft-Graph - As an Azure AD Admin how you can get a valid access_token for another user 使用Microsoft graph API或Azure AD graph API从用户界面中删除对用户的应用程序访问 - Removing application access to user from User interface by using Microsoft graph API or Azure AD graph api 使用 Azure AD 和 Microsoft Graph API 的 SSO 究竟是如何完成的? - How is SSO with Azure AD and Microsoft Graph API actually done? 带有外部帐户和Microsoft Graph API的Azure AD - Azure AD with external accounts and Microsoft Graph API
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM