国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 開發 > 綜合 > 正文

匿名訪問ReportService報表服務器(一)

2024-07-21 02:49:59
字體:
來源:轉載
供稿:網友
匿名訪問ReportService報表服務器(一)

  我的數據庫版本是sql server 2008 r2,系統環境是windows server2008.

  對于sql server 2008 r2上報rs報表的匿名訪問問題,我這邊嘗試過兩個可行方案:

  (1)使用ReportViewer展現報表,實現ReportViewer.ReportServerCredentials 對應的接口IReportServerCredentials,在接口中指定特定的用戶名和密碼。

  (2)直接訪問RS報表頁面,通過修改RS配置文件和SQL團隊技術博客所提供的認證和安全節點下擴展類。

  (3)直接訪問RS報表頁面,指定用戶名和密碼來認證(我想這個可能性也是有的,只是沒有做實驗)

  兩種方案比較:

  方案(1)實現起來簡單,但ReportViewer本身內存泄漏的問題,建議不要輕易嘗試,另外它不是根本上的匿名訪問,實際使用的時候需要配置用戶名和密碼。

  方案(2)配置起來比較繁瑣,但卻是真正意義上的匿名訪問。

  由于第二種方案能解決我現有項目的問題,所以本篇博客專注寫第二種方案的實現方式。

  需要修改的配置和使用的資源:

  (1)*:/PRogram Files/Microsoft SQL Server/MSRS10_50.MSSQLSERVER/Reporting Services/ReportServer 文件夾下的web.config、rssrvpolicy.config和rsreportserver.config

  (2)*:/Program Files/Microsoft SQL Server/MSRS10_50.MSSQLSERVER/Reporting Services/ReportManager文件夾下的web.config

  (3)Microsoft.Samples.ReportingServices.AnonymousSecurity.dll(微軟SQL技術博客提供的擴展類)

  配置Steps:

  (1)將文件Microsoft.Samples.ReportingServices.AnonymousSecurity.dll拷貝到*:/Program Files/Microsoft SQL Server/MSRS10_50.MSSQLSERVER/Reporting Services/ReportServer/bin目錄下的。

  (2)對于上面提到的兩個web.config文件,將下面代碼

<authentication mode="Windows" /><identity impersonate="true" />

替換成

<!--<authentication mode="Windows" />    <identity impersonate="true" />-->      <authentication mode="None" />      <identity impersonate="false"/>

  (3)對于rsreportserver.config文件:

將下面代碼

<Authentication>        <AuthenticationTypes>            <RSWindowsNTLM/>        </AuthenticationTypes>        <RSWindowsExtendedProtectionLevel>Off</RSWindowsExtendedProtectionLevel>        <RSWindowsExtendedProtectionScenario>Proxy</RSWindowsExtendedProtectionScenario>        <EnableAuthPersistence>true</EnableAuthPersistence>    </Authentication>

  修改為

<Authentication>        <AuthenticationTypes>            <!--<RSWindowsNTLM/>-->            <Custom/>        </AuthenticationTypes>        <RSWindowsExtendedProtectionLevel>Off</RSWindowsExtendedProtectionLevel>        <RSWindowsExtendedProtectionScenario>Proxy</RSWindowsExtendedProtectionScenario>        <EnableAuthPersistence>true</EnableAuthPersistence>    </Authentication>

將下面代碼

        <Security>            <Extension Name="Windows" Type="Microsoft.ReportingServices.Authorization.WindowsAuthorization, Microsoft.ReportingServices.Authorization"/>        </Security>        <Authentication>            <Extension Name="Windows" Type="Microsoft.ReportingServices.Authentication.WindowsAuthentication, Microsoft.ReportingServices.Authorization"/>        </Authentication>                

修改為

<Security>            <!--<Extension Name="Windows" Type="Microsoft.ReportingServices.Authorization.WindowsAuthorization, Microsoft.ReportingServices.Authorization"/>-->            <Extension Name="None" Type="Microsoft.Samples.ReportingServices.AnonymousSecurity.Authorization, Microsoft.Samples.ReportingServices.AnonymousSecurity" />        </Security>        <Authentication>            <!--<Extension Name="Windows" Type="Microsoft.ReportingServices.Authentication.WindowsAuthentication, Microsoft.ReportingServices.Authorization"/>-->            <Extension Name="None" Type="Microsoft.Samples.ReportingServices.AnonymousSecurity.AuthenticationExtension, Microsoft.Samples.ReportingServices.AnonymousSecurity" />        </Authentication>

(4)對于rssrvpolicy.config文件,將下面代碼

<CodeGroup                            class="UnionCodeGroup"                            version="1"                            PermissionSetName="FullTrust"                            Name="Private_assembly"                            Description="This code group grants custom code full trust. ">                            <IMembershipCondition                                class="UrlMembershipCondition"                                version="1"                                Url="D:/Program Files/Microsoft SQL Server/MSRS10_50.MSSQLSERVER/Reporting Services/ReportServer/bin/Microsoft.Samples.ReportingServices.AnonymousSecurity.dll" />                        </CodeGroup>

添加到

 <CodeGroup                             class="FirstMatchCodeGroup"                            version="1"                            PermissionSetName="Nothing">                        <IMembershipCondition                                 class="AllMembershipCondition"                                version="1"                        />

節點里面,作為這個節點的子節點。

(5)重啟SQL Server Reporting Service。

參照網址:http://blogs.msdn.com/b/jameswu/archive/2008/07/15/anonymous-access-in-sql-rs-2008.aspx


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 酒泉市| 寻甸| 淮北市| 霞浦县| 华宁县| 黄龙县| 鸡泽县| 江津市| 宁城县| 沙坪坝区| 烟台市| 平和县| 自贡市| 浠水县| 南木林县| 白山市| 靖宇县| 迭部县| 徐水县| 宜良县| 临澧县| 天等县| 泸溪县| 唐山市| 若尔盖县| 大新县| 敦煌市| 西城区| 昆山市| 桐乡市| 临颍县| 浏阳市| 来宾市| 石阡县| 小金县| 波密县| 莎车县| 容城县| 苗栗市| 浦江县| 中宁县|