SSRS客户端证书自定义身份验证

时间:2020-09-05 21:23:08

标签: c# asp.net authentication reporting-services client-certificates

尝试使用客户端证书为示例表单身份验证设置作为基础时,尝试为SQL Server Reporting Services(SSRS)实现自定义身份验证时遇到问题。具体来说,我正在尝试访问CERT_SUBJECT中的logon.aspx服务器变量,但是我尝试了多种方法来访问它,它们都返回一个空值:

  • Request.ClientCertificate.Subject
  • Context.Request.ServerVariables["CERT_SUBJECT"]
  • Request.ServerVariables["CERT_SUBJECT"]

我有一个需要客户端证书的IIS服务器,该证书使用URL重写将/reports/reportserver路径重定向到正确的SSRS URL(localhost/reportslocalhost/reportserver)。我还配置了重写规则以通过CERT_SUBJECT,并且可以通过强制规则重定向到原始变量{C:0}来确认正确传递了服务器变量,该变量确实显示了证书地址栏中的主题。

报告/web.config:

<rules>
    <rule name="ReverseProxyInboundRule1" enabled="true" stopProcessing="true">
        <match url="(.*)" />
        <action type="Rewrite" url="http://localhost:8080/reports/{R:0}" appendQueryString="true" />
        <conditions trackAllCaptures="true">
            <add input="{CERT_SUBJECT}" pattern="(.*)" />
        </conditions>
        <serverVariables>
            <set name="CERT_SUBJECT" value="{C:0}" />
        </serverVariables>
    </rule>
</rules>

reportserver / web.config:

<rules>
    <rule name="ReverseProxyInboundRule1" enabled="true" stopProcessing="true">
        <match url="(.*)" />
        <action type="Rewrite" url="http://localhost:8080/reportserver/{R:0}" appendQueryString="true" logRewrittenUrl="false" />
        <conditions trackAllCaptures="true">
            <add input="{CERT_SUBJECT}" pattern="(.*)" />
        </conditions>
        <serverVariables>
            <set name="CERT_SUBJECT" value="{C:0}" />
        </serverVariables>
    </rule>
</rules>

因此,我将问题限制为与SSRS的配置文件或我不知道的ASP.net设置有关的问题。但是,我对Web服务器和ASP.net缺乏经验,所以我不知道下一步该怎么做。

通过遵循该示例,我可以进行基本的表单身份验证(用户名/密码)。

这类似于在这里发现的问题:https://github.com/Microsoft/Reporting-Services/tree/master/CustomSecuritySample

0 个答案:

没有答案