如何使用AppOnly权限在Provider托管应用程序中获取当前登录用户 [英] How to get current logged in user in Provider hosted app with AppOnly permissions

查看:48
本文介绍了如何使用AppOnly权限在Provider托管应用程序中获取当前登录用户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我创建了一个Provider托管应用,并在AppManifest.xml中将Permissions设置为AppOnly。


我需要获取Provider托管应用程序中当前登录的用户。我该怎么做? 


任何想法?




Prateek Srivastava

解决方案

您好,


您可以获得当前用户。

 clientContext.Web.EnsureUser(HttpContext.Current.User.Identity.Name)

最好的问候,


Lee


Hi,

I have created a Provider hosted app and set the Permissions as AppOnly in AppManifest.xml.

I need to get the current logged in user in the Provider hosted app. How do I get that? 

Any ideas?


Prateek Srivastava

解决方案

Hi,

You could get current user by.

clientContext.Web.EnsureUser(HttpContext.Current.User.Identity.Name)

Best Regards,

Lee


这篇关于如何使用AppOnly权限在Provider托管应用程序中获取当前登录用户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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