如何从Excel外接程序中识别Office 365用户帐户 [英] How to Identify an Office 365 User Account from inside an Excel Add in

查看:267
本文介绍了如何从Excel外接程序中识别Office 365用户帐户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想了解是否有任何API可以帮助我们从我的Excel加载项javascript代码中找到Office 365用户帐户信息. 例如,假设具有Office电子邮件帐户abc@xyz.com的用户启动Excel,从Office商店下载我的加载项并使用它. 我想从我的应用程序中为下载/使用我的应用程序的各个用户捕获此用户信息. 在Office应用程序中是否有API可以实现此目的?

I would like to understand if there is any API which can help us find the Office 365 user account information from my Excel add-in javascript code. Eg- Let's assume a user with Office email account abc@xyz.com launches Excel, downloads my add-in from Office store and uses it. I want to capture this user info from my app for the various users who downloaded/using my app. Is there an API in apps for office to achieve this?

推荐答案

要添加到Doug的响应中:尽管它不公开用户的电子邮件地址,但您可以从权利令牌中获得用户的唯一标识符,前提是您的应用程序在Office商店中.请参阅 https://msdn.microsoft.com/en-us/library/office/jj164035.aspx 了解更多信息.

To add to Doug's response: while it doesn't expose the user's email address, you can get a unique identifier for the user from the entitlement token, provided your app is in the Office Store. See https://msdn.microsoft.com/en-us/library/office/jj164035.aspx for more info.

权利令牌响应的UserId属性( https://msdn.microsoft.com/zh-cn/library/office/verificationsvc.verifyentitlementtokenresponse_members.aspx )是购买者ID.根据上面的文档,这是购买应用程序的人使用的Microsoft帐户的加密值".

The UserId property of the entitlement token response (https://msdn.microsoft.com/en-us/library/office/verificationsvc.verifyentitlementtokenresponse_members.aspx) is the purchaser ID. Per the documentation above, "This is an encrypted value of the Microsoft account used by the person who purchased the app".

希望这会有所帮助,

〜MSFT Office可扩展性团队的开发人员Michael Zlatkovsky

~ Michael Zlatkovsky, developer on Office Extensibility team, MSFT

这篇关于如何从Excel外接程序中识别Office 365用户帐户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆