我在IIS 7.5上運行的應用程序ServiceStack,與/auth/credentials
服務定製CredentialsAuthProvider。ServiceStack證書身份驗證的端點提供了404
它可以從Visual Studio很好,但是當我在生產服務器上安裝它(也IIS 7.5),它響應404的所有請求/auth/credentials
。它沒有任何麻煩的服務端點REST,如果我改變供應商的超類BasicAuthProvider認證工作,但我想用的形式,而不是基本身份驗證。我如何才能正確地提供auth端點?
這是我的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>
+1,嘗試建立ServiceStack應用程序在使用MonoDevelop的,而不是Visual Studio中的。它並不隱藏這樣的東西。 –
謝謝!我將ServiceStack設置爲從根路徑主持,調整了一些端點,現在一切正常。 – Phssthpok