Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/reporting-services/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Reporting services 使用reporting services的单点登录的Web浏览器控件_Reporting Services_Httpwebrequest_Ssrs 2008_Webbrowser Control_Single Sign On - Fatal编程技术网

Reporting services 使用reporting services的单点登录的Web浏览器控件

Reporting services 使用reporting services的单点登录的Web浏览器控件,reporting-services,httpwebrequest,ssrs-2008,webbrowser-control,single-sign-on,Reporting Services,Httpwebrequest,Ssrs 2008,Webbrowser Control,Single Sign On,我的目标是从带有嵌入式浏览器的WPF应用程序执行单点登录功能。为此需要实现单点登录,这样用户就不会被要求再次输入此凭据以检查来自wpf浏览器的报告。我需要创建一个本地环境,以便从我的角度测试此功能,因为我正在为一个产品(即sql报表)进行开发,该产品具有表单身份验证和从应用程序记录到报表的功能。我在网上浏览了几乎所有与此实现相关的内容,microsoft提供的表单验证示例不起作用。我还发现该示例在基于安腾的处理器等环境中无法工作。。我正在研究ssrs 2012。登录并捕获报告站点的DOM并创建登

我的目标是从带有嵌入式浏览器的WPF应用程序执行单点登录功能。为此需要实现单点登录,这样用户就不会被要求再次输入此凭据以检查来自wpf浏览器的报告。我需要创建一个本地环境,以便从我的角度测试此功能,因为我正在为一个产品(即sql报表)进行开发,该产品具有表单身份验证和从应用程序记录到报表的功能。我在网上浏览了几乎所有与此实现相关的内容,microsoft提供的表单验证示例不起作用。我还发现该示例在基于安腾的处理器等环境中无法工作。。我正在研究ssrs 2012。登录并捕获报告站点的DOM并创建登录名不是一个好主意,因为这是针对产品的,报告登录名将不同。我正在考虑使用Httpwebrequest和Response实现,但仍然不清楚如何实现。有人请为我的实施提供清晰有效的解决方案。提前谢谢

有人请给我提供一个简洁有效的解决方案 实施

我不会指望这一点,尤其是如果你要求一个源代码解决方案


单点登录假定您在某处仍然有一个身份验证服务器,例如。从你的问题来看,我不太清楚这是否是你想要的。如果您只需要向
WebBrowser
控件提供自定义凭据,那就是,但该解决方案适用于
WebBrowser
控件。由于不允许自定义,因此您可能会更幸运地在WPF项目中使用托管WinForms
WebBrowser

我终于找到了实现reporting services单点登录的方法。实现表单身份验证的单点登录的标准方法是使用自定义安全扩展示例。配置有点棘手,但一旦配置完成,就需要通过在reporting service中调用Logonuser()methon来获取身份验证令牌来完成单点登录。下面的代码传递凭据并返回auth令牌

配置表单身份验证可在此处找到详细信息

下面的代码帮助我实现单点登录

 [DllImport("wininet.dll", CharSet = CharSet.Auto, SetLastError = true)]
static extern bool InternetSetCookie(string lpszUrlName, string lpszCookieName, string lpszCookieData);
private void GetAuthToken(string username, string password)
{
// Step1: Add reference to report service either by directly referencing the reportinservice.asmx service of by converting wsdl to class file.

 ReportServerProxy2010 rsProxy = new ReportServerProxy2010();
//Step2: Assign the report server service eg:"http://<servername>/ReportServer/ReportService2010.asmx";

              rsProxy.Url = string.Format(ReportServerUrl, ReportServer);
try
              {
                rsProxy.LogonUser(username,password, null);
                Cookie authCookie = rsProxy.AuthCookie;
if (authCookie != null)
                {
//Internet Set Cookie is a com method which sets the obtained auth token to internet explorer

                  InternetSetCookie(Url, null, authCookie.ToString());
                }
              }
catch (Exception ex)
              {
              }
            }
//When navigating now, the auth token is accepted and report manager page is displayed directly without asking for login credentials.
WebBrowserControl.Navigate(new Uri("");}
[DllImport(“wininet.dll”,CharSet=CharSet.Auto,SetLastError=true)]
静态外部bool InternetSetCookie(字符串lpszUrlName、字符串lpszCookieName、字符串lpszCookieData);
私有void GetAuthToken(字符串用户名、字符串密码)
{
//步骤1:通过直接引用的reportinservice.asmx服务或将wsdl转换为类文件来添加对报表服务的引用。
ReportServerProxy2010 rsProxy=新的ReportServerProxy2010();
//步骤2:分配报表服务器服务,例如:http:///ReportServer/ReportService2010.asmx";
rsProxy.Url=string.Format(ReportServerUrl,ReportServer);
尝试
{
rsProxy.LogonUser(用户名、密码、null);
Cookie authCookie=rsProxy.authCookie;
if(authCookie!=null)
{
//Internet Set Cookie是一种com方法,它将获取的身份验证令牌设置为Internet explorer
InternetSetCookie(Url,null,authCookie.ToString());
}
}
捕获(例外情况除外)
{
}
}
//现在导航时,将接受auth令牌,并直接显示报表管理器页面,而无需请求登录凭据。
WebBrowserControl.Navigate(新Uri(“”;}

感谢您的回复,我查看了您提供的链接,但是我们从advapi.dll实现的方法LogonUser检查了windows身份验证。我希望通过传递用户凭据导航到网站。谢谢。