表单身份验证/ Reporting Services - 获取用户名

时间:2021-09-30 08:23:28

From what variable can you pick up the username from Forms Authentication in Microsoft SQL Reporting Services? The User!UserId value comes back as the Windows Account that reporting services is running under.

您可以从哪个变量中获取Microsoft SQL Reporting Services中的表单身份验证的用户名? User!UserId值作为运行报告服务的Windows帐户返回。

1 个解决方案

#1


2  

I'm not 100% sure where you are confused here so please let me know if this isn't what you're looking for. I solved this issue myself a couple months ago when working with reporting services.

我不是百分百肯定你在这里迷茫的地方所以请告诉我这是不是你想要的。几个月前,我在处理报告服务时解决了这个问题。

I found this chunk of code in my login.aspx.cs which is being called right after I've verified that a given username/password is authenticated/authorized.

我在login.aspx.cs中找到了这一块代码,在我确认给定的用户名/密码经过身份验证/授权后立即调用。


// Setup a remote session with the current userID as the AuthCookie username.
// This userID is subsequently passed to reporting services as the UserID running the report
authCookie = FormsAuthentication.GetAuthCookie("the username here", false);

If this isn't enough information I can help you if you clarify your question.

如果这不是足够的信息,我可以帮助您澄清您的问题。

#1


2  

I'm not 100% sure where you are confused here so please let me know if this isn't what you're looking for. I solved this issue myself a couple months ago when working with reporting services.

我不是百分百肯定你在这里迷茫的地方所以请告诉我这是不是你想要的。几个月前,我在处理报告服务时解决了这个问题。

I found this chunk of code in my login.aspx.cs which is being called right after I've verified that a given username/password is authenticated/authorized.

我在login.aspx.cs中找到了这一块代码,在我确认给定的用户名/密码经过身份验证/授权后立即调用。


// Setup a remote session with the current userID as the AuthCookie username.
// This userID is subsequently passed to reporting services as the UserID running the report
authCookie = FormsAuthentication.GetAuthCookie("the username here", false);

If this isn't enough information I can help you if you clarify your question.

如果这不是足够的信息,我可以帮助您澄清您的问题。