跳转至

用户界面#

所有用户界面均由Microsoft IIS提供服务。为了保护IIS提供的所有资源,我们开发了一个IIS模块,以确保只有经过身份验证的用户才能访问凯睿德制造软件用户界面资产。

Web.config#

要设置用户界面以使用安全门户,只需将安全门户添加到Web.config中。

所有以/iis/开头的URL不应由URL重写进行处理,否则本模块将不起作用。请将<add input="{REQUEST_URI}" matchType="Pattern" pattern="^/iis(/.*)?$" ignoreCase="true" negate="true"/>添加到URL重写匹配表达式中。

<configuration>
    <connectionStrings>
        <!-- IIS Session Storage -->
        <add name="SessionDatabase" connectionString="Data Source={DatabaseServer}\{Instance};Initial Catalog={DatabaseName};User ID={User};Password={Password};" providerName="System.Data.SqlClient"/>
    </connectionStrings>

    <system.webServer>
        <!-- Modules order is important -->
        <modules>
            <!-- Authentication Module -->
            <add name="CmfAuth" type="Cmf.Auth.IIS.Module.AuthenticationModule, Cmf.Auth.IIS.Module"/>
            <!-- Report Authentication (optional) -->
            <add name="CmfAuthReports" type="Cmf.Auth.IIS.Module.ReportServer.ReportServerModule, Cmf.Auth.IIS.Module"/>
        </modules>
    </system.webServer>
    <appSettings>
        <add key="CmfAuth_ClientId" value="{SecurityPortal Client Id}"/>
        <add key="CmfAuth_ClientSecret" value="{Security Portal Client Secret}"/>
        <add key="CmfAuth_UserEndpoint" value="http(s)://{SecurityPortalAddress}:{SecurityPortalPort}/tenant/{tenantName}/"/>
        <add key="CmfAuth_ApiEndpoint" value="http(s)://{SecurityPortalAddress}:{SecurityPortalPort}/api/tenant/{tenantName}/"/>
        <!-- For multi-tenant support. Use <tenant> has {tenantName} placeholder -->
        <!--<add key="CmfAuth_UrlMatcher" value="^http://(?&lt;tenant&gt;[^\..]+)\.local\.com.*$" />-->
        <add key="CmfAuthReports_ReportServerBaseUrl" value="http://{ReportServer}/" />
    </appSettings>
</configuration>