2016-03-19 16 views
1

私は誰かが私に正しい方向へのプッシュを与えることを望んでいました。私はVisual Studios 2015コミュニティ版を使用しています。asp.netのユーザーがログインしていますが、ログインページに戻る

私のLogin.aspxページは、アカウントフォルダにあります。 Accountフォルダのweb.configファイルは次のようになります。

<?xml version="1.0"?> 
<configuration> 

<location path="Manage.aspx"> 
<system.web> 
    <authorization> 
    <deny users="?"/> 
    </authorization> 
</system.web> 
</location> 

<location path="Home.aspx"> 
<system.web> 
    <authorization> 
    <deny users="?"/> 
    </authorization> 
</system.web> 
</location> 
<location path="Home"> 
<system.web> 
    <authorization> 
    <deny users="?"/> 
    </authorization> 
</system.web> 
</location> 

</configuration> 

アカウントフォルダにもHome.aspxファイルがあります。 Home.aspxファイルに直接移動すると、期待どおりにログインページにリダイレクトされます。私がログインすると、私はSite.Masterテンプレートのロジックが私を歓迎するようにログインすることがわかります。しかし、私はHome.aspxサイトにリダイレクトされませんが、ログインページに残ります。

url文字列のreturnurl値が正しいページにナビゲートしようとしているようです。

http://localhost:63960/Account/Login?ReturnUrl=%2fAccount%2fHome.aspx 

ただし、私はログインページに残ります。

ルートフォルダのweb.configは次のようになります。

<?xml version="1.0" encoding="utf-8"?> 

<configuration> 
<configSections> 

</configSections> 
<connectionStrings> 
<add name="EventDBContext" connectionString="Data Source=.;Initial Catalog=SampleDB;Integrated Security=True;" providerName="System.Data.SqlClient"/> 
<add name="ApplicationServices" connectionString="Data Source=.;Initial Catalog=SampleDB;Integrated Security=True;" providerName="System.Data.SqlClient" /> 
</connectionStrings> 
<system.web> 
<authentication mode="Forms"> 
    <forms loginUrl="~/Account/Login.aspx" timeout="2880" /> 
</authentication> 
<compilation debug="true" targetFramework="4.5.2" /> 
<httpRuntime targetFramework="4.5.2" /> 
<pages> 
    <namespaces> 
    <add namespace="System.Web.Optimization" /> 
    <add namespace="Microsoft.AspNet.Identity" /> 
    </namespaces> 
    <controls> 
    <add assembly="Microsoft.AspNet.Web.Optimization.WebForms" namespace="Microsoft.AspNet.Web.Optimization.WebForms" tagPrefix="webopt" /> 
    </controls> 
    </pages> 
    <membership> 
    <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="/" /> 
    </providers> 
</membership> 
<profile> 
    <providers> 
    <clear /> 
    <add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="ApplicationServices" applicationName="/" /> 
    </providers> 
    </profile> 
    <roleManager enabled="true"> 

    <providers> 
    <clear /> 
    <add name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="ApplicationServices" applicationName="/" /> 
    <add name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider" applicationName="/" /> 

    </providers> 
    </roleManager> 

    <sessionState mode="InProc" customProvider="DefaultSessionProvider"> 
    <providers> 
    <add name="DefaultSessionProvider" type="System.Web.Providers.DefaultSessionStateProvider, System.Web.Providers, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31xxxxxxxe35" connectionStringName="DefaultConnection" /> 
    </providers> 
    </sessionState> 
    <httpModules> 
    <add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web" /> 
    </httpModules> 
    </system.web> 
    <system.webServer> 
    <modules> 

    <remove name="ApplicationInsightsWebTracking" /> 
    <add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web" preCondition="managedHandler" /> 
    </modules> 
    <validation validateIntegratedModeConfiguration="false" /> 
</system.webServer> 
<runtime> 
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> 
    <dependentAssembly> 
    <assemblyIdentity name="Newtonsoft.Json" culture="neutral" publicKeyToken="30xxxxxxed" /> 
    <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" /> 
    </dependentAssembly> 
    <dependentAssembly> 
    <assemblyIdentity name="WebGrease" culture="neutral" publicKeyToken="31xxxxxxxe35" /> 
    <bindingRedirect oldVersion="0.0.0.0-1.5.2.14234" newVersion="1.5.2.14234" /> 
    </dependentAssembly> 
    <dependentAssembly> 
    <assemblyIdentity name="EntityFramework" publicKeyToken="b77xxxxx89" /> 
    <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" /> 
    </dependentAssembly> 
    <dependentAssembly> 
    <assemblyIdentity name="Microsoft.Owin" culture="neutral" publicKeyToken="31xxxxxxxe35" /> 
    <bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0" /> 
    </dependentAssembly> 
    <dependentAssembly> 
    <assemblyIdentity name="Microsoft.Owin.Security.OAuth" culture="neutral" publicKeyToken="31xxxxxxxe35" /> 
    <bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0" /> 
    </dependentAssembly> 
    <dependentAssembly> 
    <assemblyIdentity name="Microsoft.Owin.Security.Cookies" culture="neutral" publicKeyToken="31xxxxxxxe35" /> 
    <bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0" /> 
    </dependentAssembly> 
    <dependentAssembly> 
    <assemblyIdentity name="Microsoft.Owin.Security" culture="neutral" publicKeyToken="31xxxxxxxe35" /> 
    <bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0" /> 
    </dependentAssembly> 
    </assemblyBinding> 
</runtime> 
<system.codedom> 
<compilers> 
    <compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31xxxxxxxe35" warningLevel="4" compilerOptions="/langversion:6 /nowarn:1659;1699;1701" /> 
    <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31xxxxxxxe35" warningLevel="4" compilerOptions="/langversion:14 /nowarn:41008 /define:_MYTYPE=\&quot;Web\&quot; /optionInfer+" /> 
</compilers> 
</system.codedom> 
</configuration> 

ご指摘いただければ幸いです。

答えて

0

私は私の問題を理解しました。私は、以前のフォーム認証アプローチをasp.net Identityアプローチと組み合わせていました。

私はすべてをアイデンティティアプローチに変換しておらず、すべて正常に動作しています。

関連する問題