SSRS WindowsIdentity.GetCurrent() 给我 NT AUTHORITY\NETWORK SERVICE
我在 SSRS 报告中有自定义代码,需要获取当前用户。例如,
Dim myPrincipal As New System.Security.Principal.WindowsPrincipal
(System.Security.Principal.WindowsIdentity.GetCurrent())
我希望 GetCurrent() 返回正在访问报告的用户的主体;然而,它给了我“NT AUTHORITY\NETWORK SERVICE”的主体。有谁知道如何让 ReportServer 作为运行报表的用户运行?我检查了两个 web.config,它们都指示 Windows 身份验证和 Impersonate=True。
I have custom code inside of a SSRS report that needs to get the current user. e.g.
Dim myPrincipal As New System.Security.Principal.WindowsPrincipal
(System.Security.Principal.WindowsIdentity.GetCurrent())
I would have expected GetCurrent() to return the principal of the user that was accessing the report; however, it gives me the principal of "NT AUTHORITY\NETWORK SERVICE". Does anyone know how to get ReportServer to run as the user running the report? I checked both web.config, and they both indicate Windows Authentication and Impersonate=True.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好吧,我明白了。我只是使用
而不是
当我在本地预览报告时这不起作用,
但在部署到服务器后它工作正常。
Ok, I figured it out. I just used
instead of
This doesn't work when I'm am previewing the report locally i.e.
but it works fine after I deploy to a server.