0

我一直致力于将 asp.net 应用程序转换为 windows azure 应用程序。我设法让它工作,但是我一直在搞乱 webconfig 以至于现在我无法让它恢复离线工作:P

我用 ACS 配置了它,但我似乎无法禁用它。

编辑:

这是我的网络配置:

<?xml version="1.0" encoding="utf-8"?>
<!--
  For more information on how to configure your ASP.NET application, please visit
  http://go.microsoft.com/fwlink/?LinkId=169433
  -->
<configuration>
    <configSections>
        <section name="microsoft.identityModel" type="Microsoft.IdentityModel.Configuration.MicrosoftIdentityModelSection, Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=asdfasdfsdfsdf" />
    </configSections>
    <system.diagnostics>
        <trace>
            <listeners>
                <add type="Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics, Version=1.7.0.0, Culture=neutral, PublicKeyToken=sadfasdfsadfasdf" name="AzureDiagnostics">
                    <filter type="" />
                </add>
            </listeners>
        </trace>
    </system.diagnostics>
    <connectionStrings>
        <add name="ApplicationServices" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnetdb.mdf;User Instance=true" providerName="System.Data.SqlClient" />
        <add name="DefaultConnection" connectionString="Data Source=.\SQLEXPRESS;Initial Catalog=aspnet_aa8d9cfe6be24b4aa01a7c093647b6df;Integrated Security=True;MultipleActiveResultSets=True" providerName="System.Data.SqlClient" />
    </connectionStrings>
    <location path="FederationMetadata">
        <system.web>
            <authorization>
                <allow users="*" />
            </authorization>
        </system.web>
    </location>
    <system.web>
        <httpRuntime requestValidationMode="2.0" />
        <authorization>
            <deny users="?" />
        </authorization>
        <authentication mode="None" />
        <compilation debug="true" targetFramework="4.0">
            <assemblies>
                <add assembly="Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=asdfasdfsdafsdf" />
            </assemblies>
        </compilation>
        <!--Commented out by FedUtil-->
        <!--<authentication mode="Forms"><forms loginUrl="~/Account/Login.aspx" timeout="2880" /></authentication>-->
        <membership defaultProvider="DefaultMembershipProvider">
            <providers>
                <clear />
                <add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="ApplicationServices" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" applicationName="/" />
                <add name="DefaultMembershipProvider" type="System.Web.Providers.DefaultMembershipProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=asdfasdfsdafsdafasd" connectionStringName="DefaultConnection" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" applicationName="/" />
            </providers>
        </membership>
        <profile defaultProvider="DefaultProfileProvider">
            <providers>
                <clear />
                <add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="ApplicationServices" applicationName="/" />
                <add name="DefaultProfileProvider" type="System.Web.Providers.DefaultProfileProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=asdfasdfsdafasd" connectionStringName="DefaultConnection" applicationName="/" />
            </providers>
        </profile>
        <roleManager enabled="false" defaultProvider="DefaultRoleProvider">
            <providers>
                <clear />
                <add name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="ApplicationServices" applicationName="/" />
                <add name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider" applicationName="/" />
                <add name="DefaultRoleProvider" type="System.Web.Providers.DefaultRoleProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=sadfsadfasdfasdfasdf" connectionStringName="DefaultConnection" applicationName="/" />
            </providers>
        </roleManager>
        <sessionState mode="InProc" customProvider="DefaultSessionProvider">
            <providers>
                <add name="DefaultSessionProvider" type="System.Web.Providers.DefaultSessionStateProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=asdfsdafsdafasdf" connectionStringName="DefaultConnection" applicationName="/" />
            </providers>
        </sessionState>
    </system.web>
    <system.webServer>
        <modules runAllManagedModulesForAllRequests="true">
            <add name="WSFederationAuthenticationModule" type="Microsoft.IdentityModel.Web.WSFederationAuthenticationModule, Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=asdfsdafasdfasdf" preCondition="managedHandler" />
            <add name="SessionAuthenticationModule" type="Microsoft.IdentityModel.Web.SessionAuthenticationModule, Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=sadfasdfsdfsdfasdf" preCondition="managedHandler" />
        </modules>
        <handlers>
            <add name="ChartHandles" path="ChartImage.axd" verb="*" type="Telerik.Web.UI.ChartHttpHandler, Telerik.Web.UI, Version=2009.2.826.20, Culture=neutral, PublicKeyToken=sadfasdfsdafsdafas" />
            <add name="Telerik_Web_UI_WebResource_axd" verb="*" preCondition="integratedMode" path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" />
        </handlers>
    </system.webServer>
    <appSettings>
        <add key="FederationMetadataLocation" value="https://timecontrol.accesscontrol.windows.net/FederationMetadata/2007-06/FederationMetadata.xml " />
    </appSettings>
    <microsoft.identityModel>
        <service>
            <audienceUris>
                <add value="http://127.0.0.1:81/" />
            </audienceUris>
            <applicationService>
                <claimTypeRequired>
                    <!--Following are the claims offered by STS 'https://timecontrol.accesscontrol.windows.net/'. Add or uncomment claims that you require by your application and then update the federation metadata of this application.-->
                    <claimType type="http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name" optional="true" />
                    <claimType type="http://schemas.microsoft.com/ws/2008/06/identity/claims/role" optional="true" />
                    <!--<claimType type="http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier" optional="true" />-->
                    <!--<claimType type="http://schemas.microsoft.com/accesscontrolservice/2010/07/claims/identityprovider" optional="true" />-->
                </claimTypeRequired>
            </applicationService>
            <certificateValidation certificateValidationMode="None" />
            <federatedAuthentication>
                <wsFederation passiveRedirectEnabled="true" issuer="https://timecontrol.accesscontrol.windows.net/v2/wsfederation" realm="http://127.0.0.1:81/" requireHttps="false" />
                <cookieHandler requireSsl="false" />
            </federatedAuthentication>
            <issuerNameRegistry type="Microsoft.IdentityModel.Tokens.ConfigurationBasedIssuerNameRegistry, Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=sdfsadfasdfasdfasd">
                <trustedIssuers>
                    <add thumbprint="sadfsdafasdfsdafasdfasdfasdfasdfasdfsdfasd" name="https://timecontrol.accesscontrol.windows.net/" />
                </trustedIssuers>
            </issuerNameRegistry>
        </service>
    </microsoft.identityModel>
</configuration>
4

1 回答 1

1

要禁用 Azure ACS,您至少必须更改部分

<httpRuntime requestValidationMode="2.0" />
        <authorization>
            <deny users="?" />
        </authorization>

<httpRuntime requestValidationMode="2.0" />
        <authorization>
            <allow users="*" />
        </authorization>

并且可能也被删除<httpRuntime requestValidationMode="2.0" />

如果您需要旧形式的身份验证,请取消注释

<!--Commented out by FedUtil-->
        <!--<authentication mode="Forms"><forms loginUrl="~/Account/Login.aspx" timeout="2880" /></authentication>-->
于 2013-06-06T05:39:45.130 回答