无法为SSRS2016启用CustomSecuritySample

时间:2017-05-04 14:23:18

标签: c# windows reporting-services ssrs-2016

我无法让Microsoft提供的客户安全示例工作。我在这里遵循了README for CustomerSecuritySample: https://github.com/Microsoft/Reporting-Services/tree/master/CustomSecuritySample

预期结果

我预计在重新启动服务后,在浏览器中输入http://computername/Reports时应提供登录屏幕。但我仍然得到Windows身份验证提示。我认为我错过了指南中需要完成的最后一步,以使其工作但无法弄清楚是什么

设置

实例名称:SQL2016 Reporting Services配置管理器中设置的URL:http://computername/Reports

采取的配置步骤

我按照自述文件进行了以下更改:

RSReportServer.config:

将AuthenticationTypes设置为Custom:

<AuthenticationTypes>
  <Custom/>
</AuthenticationTypes>

用新数据替换了用户界面:

<UI>
  <CustomAuthenticationUI>
    <loginUrl>/Pages/UILogon.aspx</loginUrl>
    <UseSSL>False</UseSSL>
    <PassThroughCookies>
      <PassThroughCookie>sqlAuthCookie</PassThroughCookie>
    </PassThroughCookies>
  </CustomAuthenticationUI>
  <ReportServerUrl>http://computername/Reports</ReportServerUrl>
  <PageCountMode>Estimate</PageCountMode>
</UI>

将安全性扩展信息替换为:

<Extension Name="Forms" 
  Type="Microsoft.Samples.ReportingServices.CustomSecurity.Authorization, Microsoft.Samples.ReportingServices.CustomSecurity" >
  <Configuration>
    <AdminConfiguration>
      <UserName>username</UserName>
    </AdminConfiguration>
  </Configuration>
</Extension>

将身份验证扩展名替换为:

<Extension Name="Forms" Type="Microsoft.Samples.ReportingServices.CustomSecurity.AuthenticationExtension,Microsoft.Samples.ReportingServices.CustomSecurity" />

的rssrvpolicy.config:

添加了新的代码组:

<CodeGroup
  class="UnionCodeGroup"
  version="1"
  Name="SecurityExtensionCodeGroup"
  Description="Code group for the sample security extension"
  PermissionSetName="FullTrust">
  <IMembershipCondition
    class="UrlMembershipCondition"
    version="1"
    Url="C:\Program Files\Microsoft SQL Server\MSRS13.SQL2016\Reporting Services\ReportServer\bin\Microsoft.Samples.ReportingServices.CustomSecurity.dll"/>
</CodeGroup>

的Web.config:

在system.web下添加:

<machineKey validationKey="GENERATED_VALIDATION_KEY" decryptionKey="GENERATED_DECRYPTION_KEY" validation="AES" decryption="AES" />

将身份验证模式从Windows更改为Forms并添加了授权和身份模拟:

<authentication mode="Forms">
      <forms loginUrl="logon.aspx" name="sqlAuthCookie" timeout="60" path="/"></forms>
</authentication>
<authorization>
  <deny users="?" />
</authorization>
<identity impersonate="false" />

RSWebApp / Microsoft.ReportingServices.Portal.WebHost.exe.config:

添加了与报告服务的Web.config相同的验证和解密密钥

<system.web>
  <machineKey validationKey="GENERATED_VALIDATION_KEY" decryptionKey="GENERATED_DECRYPTION_KEY" validation="AES" decryption="AES" />
</system.web>

将文件复制到正确的位置

C:\ Program Files \ Microsoft SQL Server \ MSRS13.SQL2016 \ Reporting Services \ RSWebApp:

  1. 复制Microsoft.ReportingServices.Portal.WebHost.exe.config
  2. C:\ Program Files \ Microsoft SQL Server \ MSRS13.SQL2016 \ Reporting Services \ ReportServer:  1.复制上面提到的其他三个配置文件  2.复制Login.aspx和.cs  3.将Microsoft.Samples.ReportingServices.CustomSecurity.dll复制到/ bin

2 个答案:

答案 0 :(得分:0)

我正在使用Power BI运行SSRS的预览版本,预览不支持多个实例。

当我更改C:\ Program Files \ Microsoft SQL Server Reporting Services \ RSServer \ ReportServer中的文件,然后重新启动“SQL Server Reporting Services - Standalone”时,我收到了登录提示

参考:https://github.com/techtalk/SpecFlow/pull/779

答案 1 :(得分:0)

我必须将MachineKey从Microsoft.ReportingServices.Portal.WebHost.exe.config文件(RSWebApp目录)复制到web.config文件(ReportServer目录)。