我在 IIS 7.5 上运行 ServiceStack 应用程序,自定义 CredentialsAuthProvider 服务于/auth/credentials
.
它在 Visual Studio 中运行良好,但是当我将它安装在生产服务器(也是 IIS 7.5)上时,它对所有对/auth/credentials
. 服务 REST 端点没有任何问题,如果我将提供者的超类更改为 BasicAuthProvider,身份验证工作,但我想使用表单而不是基本身份验证。我怎样才能让它正确地服务于身份验证端点?
这就是我的 Web.config 的样子:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<location path="auth">
<system.web>
<customErrors mode="Off"/>
<httpHandlers>
<add path="*" type="ServiceStack.WebHost.Endpoints.ServiceStackHttpHandlerFactory, ServiceStack" verb="*"/>
</httpHandlers>
</system.web>
</location>
<location path="rest">
<system.web>
<httpHandlers>
<add path="*" type="ServiceStack.WebHost.Endpoints.ServiceStackHttpHandlerFactory, ServiceStack" verb="*" />
</httpHandlers>
</system.web>
<!-- Required for IIS 7.0 -->
<system.webServer>
<modules runAllManagedModulesForAllRequests="true" />
<validation validateIntegratedModeConfiguration="false" />
<handlers>
<add path="*" name="ServiceStack.Factory" type="ServiceStack.WebHost.Endpoints.ServiceStackHttpHandlerFactory, ServiceStack" verb="*" preCondition="integratedMode" resourceType="Unspecified" allowPathInfo="true" />
</handlers>
</system.webServer>
</location>
<!-- Required for MONO -->
<system.web>
<httpHandlers>
<add path="rest*" type="ServiceStack.WebHost.Endpoints.ServiceStackHttpHandlerFactory, ServiceStack" verb="*"/>
<add path="auth*" type="ServiceStack.WebHost.Endpoints.ServiceStackHttpHandlerFactory, ServiceStack" verb="*"/>
</httpHandlers>
</system.web>
<system.webServer>
<validation validateIntegratedModeConfiguration="false" />
<httpErrors errorMode="DetailedLocalOnly">
<remove statusCode="403" subStatusCode="-1" />
<error statusCode="403" prefixLanguageFilePath="" path="https://nearme.solarcity.com" responseMode="Redirect" />
</httpErrors>
<!--<modules runAllManagedModulesForAllRequests="true">
<remove name="WebDAVModule" />
</modules>-->
<!--uncomment this to stop IIS 7.5 from blocking PUT and DELETE-->
</system.webServer>
</configuration>