我无法让 Microsoft 提供的客户安全示例正常工作。我在这里遵循了 CustomerSecuritySample 的 README: https ://github.com/Microsoft/Reporting-Services/tree/master/CustomSecuritySample
预期结果
我希望在重新启动服务后,在浏览器中输入http://computername/Reports时应该会提供一个登录屏幕。但相反,我仍然收到 Windows 身份验证提示。我认为我错过了指南中的一些最后步骤,这些步骤需要完成才能使其正常工作,但无法弄清楚是什么
设置
实例名称:在 Reporting Services 配置管理器中设置的 SQL2016 URL:http://computername/Reports
采取的配置步骤
在我遵循自述文件的地方进行了以下更改:
RSReportServer.config:
将 AuthenticationTypes 设置为自定义:
<AuthenticationTypes>
<Custom/>
</AuthenticationTypes>
用新数据替换 UI:
<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>
网络配置:
在 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:
- 复制 Microsoft.ReportingServices.Portal.WebHost.exe.config
C:\Program Files\Microsoft SQL Server\MSRS13.SQL2016\Reporting Services\ReportServer: 1. 复制上面提到的其他三个配置文件 2. 复制 Login.aspx 和 .cs 3. 复制 Microsoft.Samples.ReportingServices.CustomSecurity.dll进入 /bin