欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

cas错误:org.jasig.cas.client.validation.TicketValidationException: No principal wa

程序员文章站 2022-07-13 10:37:04
...

cas错误:org.jasig.cas.client.validation.TicketValidationException: No principal was found in the response from the CAS server.

很多文章都写到jasig CAS实现单点登录,客户端配置~如新建WEB项目cas-web-client, 并加入依赖包:cas-client-core-3.2.1.jar,commons-logging-1.1.jar,在配置web.xml时

 <filter>

       <filter-name>CASFilter</filter-name>
       <filter-class>org.jasig.cas.client.authentication.AuthenticationFilter</filter-class>
        <init-param>
            <param-name>casServerLoginUrl</param-name><!-- Cas Server登录url-->
            <param-value>https://www.tomcat1.com:8443/cas/login</param-value>
        </init-param>
        <init-param><!-- 配置当前web应用所在的web服务器域名url -->
            <param-name>serverName</param-name>
            <param-value>http://www.tomcat2.com:8080</param-value>
        </init-param>
    </filter>
    <filter-mapping>
        <filter-name>CASFilter</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>
    <filter>
        <filter-name>CasTicketFilter</filter-name>
        <filter-class>
            org.jasig.cas.client.validation.Cas20ProxyReceivingTicketValidationFilter</filter-class>
        <init-param>
            <param-name>casServerUrlPrefix</param-name>
            <param-value>https://www.tomcat1.com:8443/cas</param-value><===此处必须拿掉“/cas”
        </init-param>
        <init-param>
            <param-name>serverName</param-name>
            <param-value>http://www.tomcat2.com:8080</param-value>
        </init-param>
    </filter>

 

 

哎,为何好多人都没遇到呢???最后还是

http://jasig.275507.n4.nabble.com/No-principal-was-found-in-the-response-from-the-CAS-server-td1011262.html把问题找出来....