首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > .NET >

请教CAS SSO .net客户端如何配置(急)

2012-12-16 
请问CAS SSO .net客户端怎么配置(急)?xml version1.0?configurationappSettings!--中间部分是CA

请问CAS SSO .net客户端怎么配置(急)
<?xml version="1.0"?>
<configuration>

<appSettings>
<!--中间部分是CAS需要用到的-->
<!---change CAS Url accordingly-->
<add key="CASURL" value="http://localhost:8080/cas-server-webapp-3.3.1"/>
<!--中间部分是CAS需要用到的-->
</appSettings>
<connectionStrings/>

<!--
            通过 <authentication> 节可以配置 ASP.NET 用来 
            识别进入用户的
            安全身份验证模式。 
        -->
<!--<authentication mode="Windows" />-->
<!--中间部分是CAS需要用到的-->
<!--Authentication mode configuration -->
<authentication mode="Forms">
<forms name="casAuth" defaultUrl="Default.aspx" loginUrl="Login.aspx"/>
</authentication>
<!-- Authorization configuration -->
<authorization>
<deny users="?"/>
</authorization>
<!--中间部分是CAS需要用到的-->
<!--
            如果在执行请求的过程中出现未处理的错误,
            则通过 <customErrors> 节可以配置相应的处理步骤。具体说来,
            开发人员通过该节可以配置
            要显示的 html 错误页
            以代替错误堆栈跟踪。

        -->
<customErrors mode="On" defaultRedirect="MyErrorPage.aspx">
<error statusCode="403" redirect="NoAccess.htm"/>
<error statusCode="404" redirect="FileNotFound.htm"/>
</customErrors>
<pages>
<!--中间部分是CAS需要用到的-->
<namespaces>
<add namespace="CAS.Web.Security"/>
</namespaces>
<!--中间部分是CAS需要用到的-->
<controls>
<add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</controls>
</pages>
<!--中间部分是CAS需要用到的-->
<add name="CASAuthenticationV2" type="CAS.Web.Security.CASAuthenticationV2, CASAuthentication"/>
<!--中间部分是CAS需要用到的-->
</httpModules>
</system.web>
<system.codedom>
<compilers>
<compiler language="c#;cs;csharp" extension=".cs" warningLevel="4" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<providerOption name="CompilerVersion" value="v3.5"/>
<providerOption name="WarnAsError" value="false"/>
</compiler>
</compilers>
</system.codedom>
<!-- 
        在 Internet 信息服务 7.0 下运行 ASP.NET AJAX 需要 system.webServer
        节。对早期版本的 IIS 来说则不需要此节。
    -->
<location path="ProxyCallback.aspx">
<system.web>


<authorization>
<allow users="*"/>
</authorization>
</system.web>
</location>
</configuration>
******************************************************************************************************************************上面为代理模式配置***********************************
现在情况是这样的:经过配置之后打开A网站转跳到CAS服务认证,认证过之后再转到A网站,再从A网站转跳到B网站也要求登陆,正常情况下是不用登陆的。请大家帮帮忙。。。。。。。。。。
[解决办法]
哎!自己顶一个。。。。

[解决办法]
该回复于2009-06-18 17:10:13被版主删除
[解决办法]
不会,帮顶一下。
[解决办法]
哎不知道。帮顶一下吧
[解决办法]
学习 分享
[解决办法]
楼主啊,你中间部分都混了。。。。看不出来哪些是需要加的了。。。
我只学过java,也不是专业搞java的。
可是公司的软件是.NET开发的,需要用到CAS。。。
公司又没编程人员。。。只能我看了。。。
实在是急急急啊。。。。


帮帮忙给讲解下啊。我邮箱quanshui0916@sina.com
[解决办法]
该回复于2009-09-25 10:48:53被版主删除
[解决办法]
你可以去下载一个例子,这样就知道了
[解决办法]
<?xml version="1.0"?>
 <configuration>
<configSections>
    <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net"/>
    <section name="casClientConfig" type="DotNetCasClient.Configuration.CasClientConfiguration, DotNetCasClient"/>
</configSections>
<appSettings>
    设置网页的编码名称,一定得设置正确,常使用的编码名称有:
    gb2312
    utf-8
    GBK
    -->
<add key="encodingName" value="GBK"/>
    </appSettings>
<connectionStrings>
<add name="dbConnectionString" connectionString="server=.;uid=sa;pwd=sa;database=NbCreditCrawler;"/>
    </connectionStrings>
<zytDataService defaultProvider="GlobalDataProvider">
<providers>
<add name="GlobalDataProvider" type="Starsoft.NbCreditCrawler.Data.SqlClient.Global.GlobalDataProvider, NbCreditCrawler.Data.SqlClient" connectionStringName="dbConnectionString"/>
</providers>
</zytDataService>
   <casClientConfig casServerLoginUrl="http://localhost:8080/cas-server-webapp-3.4.6/login"
          casServerUrlPrefix="http://localhost:8080/cas-server-webapp-3.4.6/"
          serverName="http://localhost:8280"
          notAuthorizedUrl="~/NotAuthorized.aspx"
          cookiesRequiredUrl="~/CookiesRequired.aspx"
          redirectAfterValidation="true"
          gateway="false"
          renew="false"
          singleSignOut="true"
          ticketTimeTolerance="5000"
          ticketValidatorName="Cas20"


          proxyTicketManager="CacheProxyTicketManager"
          serviceTicketManager="CacheServiceTicketManager"
          gatewayStatusCookieName="CasGatewayStatus"/>
   <runtime>
     <developmentMode developerInstallation="true"/>
   </runtime>
<system.web>
    <pages/>
<!--
            通过 <authentication> 节可以配置
            安全身份验证模式,ASP.NET 
            使用该模式来识别来访用户身份。 
        -->

<!--
            如果在执行请求的过程中出现未处理的错误,
            则通过 <customErrors> 节
            可以配置相应的处理步骤。具体而言,
            开发人员通过该节可配置要显示的 html 错误页,
            以代替错误堆栈跟踪。

        <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
            <error statusCode="403" redirect="NoAccess.htm" />
            <error statusCode="404" redirect="FileNotFound.htm" />
        </customErrors>
        -->
    <authentication mode="Forms">
      <forms loginUrl="http://localhost:8080/cas-server-webapp-3.4.6/login"
   timeout="30"
   defaultUrl="login.aspx"
   cookieless="UseCookies"
   slidingExpiration="true"
   path="/"/>
    </authentication>
    <authorization>
      <allow users="*"/>
    </authorization>

    <compilation debug="true"></compilation>

    <httpModules>
      <add name="DotNetCasClient" type="DotNetCasClient.CasAuthenticationModule,DotNetCasClient"/>
    </httpModules>
    <customErrors mode="RemoteOnly" defaultRedirect="../login.aspx">
      <error statusCode="413" redirect="../login.aspx"/>
      <error statusCode="404" redirect="../login.aspx"/>
    </customErrors>
    
    <httpHandlers>
      <add verb="*" path="*.ashx" type="AjaxPro.AjaxHandlerFactory,AjaxPro.2"/>
    </httpHandlers>
    
  </system.web>
  <system.webServer>
    <modules>
      <remove name="DotNetCasClient"/>
      <add name="DotNetCasClient" type="DotNetCasClient.CasAuthenticationModule,DotNetCasClient"/>


    </modules>
  </system.webServer>
   
   <!--
      定义log4net的配置信息 
     -->
   <log4net>
     <appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender">
       <param name="File" value="d:\\NbCreditCrawlerLog\"/>
       <param name="AppendToFile" value="true"/>
       <param name="MaxSizeRollBackups" value="100"/>
       <param name="StaticLogFileName" value="false"/>
       <param name="DatePattern" value="yyyyMMdd&quot;.htm&quot;"/>
       <param name="RollingStyle" value="Date"/>
       <layout type="log4net.Layout.PatternLayout">
         <param name="ConversionPattern" value="&lt;HR COLOR=red&gt;%n异常时间:%d [%t] &lt;BR&gt;%n异常级别:%-5p &#xA;  &lt;BR&gt;%n异 常 类:%c [%x] &lt;BR&gt;%n%m &lt;BR&gt;%n &lt;HR Size=1&gt;"/>
       </layout>
     </appender>
     <root>
       <level value="ALL"/>
       <appender-ref ref="RollingLogFileAppender"/>
     </root>
   </log4net>
   
   <system.diagnostics>
     <trace autoflush="true" useGlobalLock="false"/>
     <sharedListeners>
       <add name="TraceFile" type="System.Diagnostics.TextWriterTraceListener" initializeData="C:\inetpub\logs\LogFiles\DotNetCasClient.Log" traceOutputOptions="DateTime"/>
     </sharedListeners>
     <sources>
       <!-- Provides diagnostic information on module configuration parameters. -->
       <source name="DotNetCasClient.Config" switchName="Config" switchType="System.Diagnostics.SourceSwitch">
         <listeners>
           <add name="TraceFile"/>
         </listeners>
       </source>
       <!-- Traces IHttpModule lifecycle events and meaningful operations performed therein. -->
       <source name="DotNetCasClient.HttpModule" switchName="HttpModule" switchType="System.Diagnostics.SourceSwitch">
         <listeners>
           <add name="TraceFile"/>
         </listeners>
       </source>
       <!-- Provides protocol message and routing information. -->


       <source name="DotNetCasClient.Protocol" switchName="Protocol" switchType="System.Diagnostics.SourceSwitch">
         <listeners>
           <add name="TraceFile"/>
         </listeners>
       </source>
       <!-- Provides details on security operations and notable security conditions. -->
       <source name="DotNetCasClient.Security" switchName="Security" switchType="System.Diagnostics.SourceSwitch">
         <listeners>
           <add name="TraceFile"/>
         </listeners>
       </source>
     </sources>
     <switches>
       <add name="Config" value="Information"/>
       <add name="HttpModule" value="Verbose"/>
       <add name="Protocol" value="Information"/>
       <add name="Security" value="Information"/>
     </switches>
   </system.diagnostics>
   
</configuration>

热点排行