我用cas sso 做单点登录服务器,cas net client 在 .net mvc 中 使用单点登录。 配置如下:
每次登录完成 后 提示"将您重定向的次数过多" 无法定向到 默认页面。网上找了很多 没解决。谁用过帮忙看下。
服务器是没问题的,jsp 的客户端登录是可以的。
不好意思 没有豆了。
1 <?xml version="1.0" encoding="utf-8"?> 2 <!-- 3 有关如何配置 ASP.NET 应用程序的详细信息,请访问 4 http://go.microsoft.com/fwlink/?LinkId=152368 5 --> 6 <configuration> 7 <configSections> 8 <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --> 9 <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=4.4.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" /> 10 <!--定义casClientConfig--> 11 <section name="casClientConfig" type="DotNetCasClient.Configuration.CasClientConfiguration, DotNetCasClient"/> 12 13 </configSections> 14 <casClientConfig 15 casServerLoginUrl="http://192.168.128.104:9090/cas/login " 16 casServerUrlPrefix="http://192.168.128.104:9090/cas/" 17 serverName="http://localhost:12634/" 18 redirectAfterValidation="true" 19 gateway="false" 20 renew="false" 21 singleSignOut="true" 22 ticketTimeTolerance="5000" 23 notAuthorizedUrl="../NotAuthorized/NotAuthorized" 24 cookiesRequiredUrl="../CookiesRequired/CookiesRequired" 25 ticketValidatorName="Cas20" 26 proxyTicketManager="CacheProxyTicketManager" 27 serviceTicketManager="CacheServiceTicketManager" 28 gatewayStatusCookieName="CasGatewayStatus"/> 29 <!--CAS结束--> 30 <connectionStrings> 31 <add name="DefaultConnection" providerName="System.Data.SqlClient" connectionString="Data Source=(LocalDb)\v11.0;Initial Catalog=aspnet-DDCH.CP.WebApp-20171016155004;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnet-DDCH.CP.WebApp-20171016155004.mdf" /> 32 </connectionStrings> 33 <appSettings> 34 <add key="webpages:Version" value="2.0.0.0" /> 35 <add key="webpages:Enabled" value="false" /> 36 <add key="PreserveLoginUrl" value="true" /> 37 <add key="ClientValidationEnabled" value="true" /> 38 <add key="UnobtrusiveJavaScriptEnabled" value="true" /> 39 40 </appSettings> 41 <system.web> 42 <compilation debug="true" targetFramework="4.0" /> 43 <authentication mode="Forms"> 44 <forms 45 loginUrl="http://192.168.128.104:9090/cas/login" 46 timeout="30" 47 defaultUrl="../Index/Index" 48 cookieless="UseCookies" 49 slidingExpiration="true" 50 /> 51 </authentication> 52 <httpModules> 53 <add name="DotNetCasClient" 54 type="DotNetCasClient.CasAuthenticationModule,DotNetCasClient"/> 55 <!-- Other modules here --> 56 </httpModules> 57 <pages> 58 <namespaces> 59 <add namespace="System.Web.Helpers" /> 60 <add namespace="System.Web.Mvc" /> 61 <add namespace="System.Web.Mvc.Ajax" /> 62 <add namespace="System.Web.Mvc.Html" /> 63 <add namespace="System.Web.Optimization" /> 64 <add namespace="System.Web.Routing" /> 65 <add namespace="System.Web.WebPages" /> 66 </namespaces> 67 </pages> 68 <profile defaultProvider="DefaultProfileProvider"> 69 <providers> 70 <add name="DefaultProfileProvider" type="System.Web.Providers.DefaultProfileProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="DefaultConnection" applicationName="/" /> 71 </providers> 72 </profile> 73 <membership defaultProvider="DefaultMembershipProvider"> 74 <providers> 75 <add name="DefaultMembershipProvider" type="System.Web.Providers.DefaultMembershipProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="DefaultConnection" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" applicationName="/" /> 76 </providers> 77 </membership> 78 <roleManager defaultProvider="DefaultRoleProvider"> 79 <providers> 80 <add name="DefaultRoleProvider" type="System.Web.Providers.DefaultRoleProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="DefaultConnection" applicationName="/" /> 81 </providers> 82 </roleManager> 83 <!-- 84 If you are deploying to a cloud environment that has multiple web server instances, 85 you should change session state mode from "InProc" to "Custom". In addition, 86 change the connection string named "DefaultConnection" to connect to an instance 87 of SQL Server (including SQL Azure and SQL Compact) instead of to SQL Server Express. 88 --> 89 <sessionState mode="StateServer" cookieless="UseCookies" timeout="36000"> 90 91 </sessionState> 92 93 </system.web> 94 <system.webServer> 95 <validation validateIntegratedModeConfiguration="false" /> 96 <modules runAllManagedModulesForAllRequests="true" > 97 <remove name="DotNetCasClient"/> 98 <add name="DotNetCasClient" 99 type="DotNetCasClient.CasAuthenticationModule,DotNetCasClient"/> 100 </modules> 101 102 <handlers> 103 <remove name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" /> 104 <remove name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" /> 105 <remove name="ExtensionlessUrlHandler-Integrated-4.0" /> 106 <add name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0" /> 107 <add name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0" /> 108 <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" /> 109 </handlers> 110 </system.webServer> 111 <runtime> 112 <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> 113 <dependentAssembly> 114 <assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" /> 115 <bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="2.0.0.0" /> 116 </dependentAssembly> 117 <dependentAssembly> 118 <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" /> 119 <bindingRedirect oldVersion="1.0.0.0-4.0.0.0" newVersion="4.0.0.0" /> 120 </dependentAssembly> 121 <dependentAssembly> 122 <assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" /> 123 <bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="2.0.0.0" /> 124 </dependentAssembly> 125 <dependentAssembly> 126 <assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" /> 127 <bindingRedirect oldVersion="1.0.0.0-1.3.0.0" newVersion="1.3.0.0" /> 128 </dependentAssembly> 129 </assemblyBinding> 130 </runtime> 131 <entityFramework> 132 <defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework"> 133 <parameters> 134 <parameter value="v11.0" /> 135 </parameters> 136 </defaultConnectionFactory> 137 </entityFramework> 138 <system.diagnostics> 139 <trace autoflush="true" useGlobalLock="false" /> 140 <sharedListeners> 141 <!-- 142 Writing trace output to a log file is recommended. 143 IMPORTANT: 144 The user account under which the containing application pool runs 145 must have privileges to create and modify the trace log file. 146 --> 147 <add name="TraceFile" 148 type="System.Diagnostics.TextWriterTraceListener" 149 initializeData="C:\inetpub\logs\LogFiles\DotNetCasClient.Log" 150 traceOutputOptions="DateTime" /> 151 </sharedListeners> 152 <sources> 153 <!-- Provides diagnostic information on module configuration parameters. --> 154 <source name="DotNetCasClient.Config" switchName="Config" switchType="System.Diagnostics.SourceSwitch" > 155 <listeners> 156 <add name="TraceFile" /> 157 </listeners> 158 </source> 159 160 <!-- Traces IHttpModule lifecycle events and meaningful operations performed therein. --> 161 <source name="DotNetCasClient.HttpModule" switchName="HttpModule" switchType="System.Diagnostics.SourceSwitch" > 162 <listeners> 163 <add name="TraceFile" /> 164 </listeners> 165 </source> 166 167 <!-- Provides protocol message and routing information. --> 168 <source name="DotNetCasClient.Protocol" switchName="Protocol" switchType="System.Diagnostics.SourceSwitch" > 169 <listeners> 170 <add name="TraceFile" /> 171 </listeners> 172 </source> 173 174 <!-- Provides details on security operations and notable security conditions. --> 175 <source name="DotNetCasClient.Security" switchName="Security" switchType="System.Diagnostics.SourceSwitch" > 176 <listeners> 177 <add name="TraceFile" /> 178 </listeners> 179 </source> 180 </sources> 181 <switches> 182 <!-- 183 Set trace switches to appropriate logging level. Recommended values in order of increasing verbosity: 184 - Off 185 - Error 186 - Warning 187 - Information 188 - Verbose 189 --> 190 <!-- 191 Config category displays detailed information about CasAuthenticationModule configuration. 192 The output of this category is only displayed when the module is initialized, which happens 193 for the first request following application/server startup. 194 --> 195 <add name="Config" value="Information"/> 196 197 <!-- 198 Set this category to Verbose to trace HttpModule lifecycle events in CasAuthenticationModule. 199 This category produces voluminous output in Verbose mode and should be avoided except for 200 limited periods of time troubleshooting vexing integration problems. 201 --> 202 <add name="HttpModule" value="Verbose"/> 203 204 <!-- 205 Set to Verbose to display protocol messages between the client and server. 206 This category is very helpful for troubleshooting integration problems. 207 --> 208 <add name="Protocol" value="Information"/> 209 210 <!-- 211 Displays important security-related information. 212 --> 213 <add name="Security" value="Information"/> 214 </switches> 215 </system.diagnostics> 216 </configuration>
这个是配置的问题
问题怎么解决的?
– 冀乔楚 6年前