2013-02-11 164 views
1

我遇到了這個問題與Spring 3.1.3版本,並與下面的應用程序上下文文件。我不太清楚爲什麼會出現這種情況。已研究過大部分與此相關的帖子。我不認爲我有版本不匹配。通用匹配模式(「/ **」)之前在過濾器鏈中的其他模式定義,使他們忽視

應用程序上下文文件:

<beans xmlns="http://www.springframework.org/schema/beans" 
    xmlns:security="http://www.springframework.org/schema/security" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:schemaLocation="http://www.springframework.org/schema/beans 
      http://www.springframework.org/schema/beans/spring-beans-3.1.xsd 
      http://www.springframework.org/schema/security 
      http://www.springframework.org/schema/security/spring-security-3.1.xsd"> 

<security:http auto-config='true' entry-point-ref="casEntryPoint" > 
    <security:intercept-url pattern="/panelpipeline/**" access="ROLE_USER"/> 
    <security:intercept-url pattern="/**" access="IS_AUTHENTICATED_ANONYMOUSLY"/> 
</security:http> 

<bean id="serviceProperties" class="org.springframework.security.cas.ServiceProperties"> 
    <property name="service" 
     value="https://seqdws1/cas/j_spring_cas_security_check" /> 
    <property name="sendRenew" value="false" /> 
</bean> 

<security:http entry-point-ref="casEntryPoint"> 
    <security:custom-filter position="CAS_FILTER" 
     ref="casFilter" /> 
</security:http> 

<bean id="casFilter" 
    class="org.springframework.security.cas.web.CasAuthenticationFilter"> 
    <property name="authenticationManager" ref="authenticationManager" /> 
</bean> 

<bean id="casEntryPoint" 
    class="org.springframework.security.cas.web.CasAuthenticationEntryPoint"> 
    <property name="loginUrl" value="https://seqdws1/cas/login" /> 
    <property name="serviceProperties" ref="serviceProperties" /> 
</bean> 

<security:authentication-manager alias="authenticationManager"> 
    <security:authentication-provider 
     ref="casAuthenticationProvider" /> 
</security:authentication-manager> 

<bean id="casAuthenticationProvider" 
    class="org.springframework.security.cas.authentication.CasAuthenticationProvider"> 
    <property name="userDetailsService" ref="userService" /> 
    <property name="serviceProperties" ref="serviceProperties" /> 
    <property name="ticketValidator"> 
     <bean class="org.jasig.cas.client.validation.Cas20ServiceTicketValidator"> 
      <constructor-arg index="0" value="https://seqdws1/cas" /> 
     </bean> 
    </property> 
    <property name="key" value="an_id_for_this_auth_provider_only" /> 
</bean> 

<security:user-service id="userService"> 
    <security:user name="joe" password="joe" authorities="ROLE_USER" />  
</security:user-service> 

<!-- <security:authentication-manager> <security:authentication-provider> 
    <security:user-service> <security:user name="jimi" password="jimispassword" 
    authorities="ROLE_USER, ROLE_ADMIN" /> <security:user name="bob" password="bobspassword" 
    authorities="ROLE_USER" /> </security:user-service> </security:authentication-provider> 
    </security:authentication-manager> --> 

POM依賴

<dependencies> 
    <dependency> 
     <groupId>com.google.gwt</groupId> 
     <artifactId>gwt-servlet</artifactId> 
     <version>${gwtVersion}</version> 
     <scope>runtime</scope> 
    </dependency> 
    <dependency> 
     <groupId>com.google.gwt</groupId> 
     <artifactId>gwt-user</artifactId> 
     <version>${gwtVersion}</version> 
     <scope>provided</scope> 
    </dependency> 
    <dependency> 
     <groupId>junit</groupId> 
     <artifactId>junit</artifactId> 
     <version>4.7</version> 
     <scope>test</scope> 
    </dependency> 
    <dependency> 
     <groupId>javax.validation</groupId> 
     <artifactId>validation-api</artifactId> 
     <version>1.0.0.GA</version> 
     <scope>test</scope> 
    </dependency> 
    <dependency> 
     <groupId>javax.validation</groupId> 
     <artifactId>validation-api</artifactId> 
     <version>1.0.0.GA</version> 
     <classifier>sources</classifier> 
     <scope>test</scope> 
    </dependency> 


    <dependency> 
     <groupId>org.springframework.security</groupId> 
     <artifactId>spring-security-core</artifactId> 
     <version>3.1.3.RELEASE</version> 
    </dependency> 
    <dependency> 
     <groupId>org.springframework.security</groupId> 
     <artifactId>spring-security-web</artifactId> 
     <version>3.1.3.RELEASE</version> 
    </dependency> 
    <dependency> 
     <groupId>org.springframework.security</groupId> 
     <artifactId>spring-security-config</artifactId> 
     <version>3.1.3.RELEASE</version> 
    </dependency> 
    <dependency> 
     <groupId>org.springframework</groupId> 
     <artifactId>spring-context</artifactId> 
     <version>3.1.3.RELEASE</version> 
    </dependency> 
    <dependency> 
     <groupId>org.springframework</groupId> 
     <artifactId>spring-beans</artifactId> 
     <version>3.1.3.RELEASE</version> 
    </dependency> 
    <dependency> 
     <groupId>org.springframework</groupId> 
     <artifactId>spring-core</artifactId> 
     <version>3.1.3.RELEASE</version> 
    </dependency> 
    <dependency> 
     <groupId>org.springframework</groupId> 
     <artifactId>spring-tx</artifactId> 
     <version>3.1.3.RELEASE</version> 
    </dependency> 
    <dependency> 
     <groupId>org.springframework</groupId> 
     <artifactId>spring-web</artifactId> 
     <version>3.1.3.RELEASE</version> 
    </dependency> 
    <dependency> 
     <groupId>org.springframework</groupId> 
     <artifactId>spring-jdbc</artifactId> 
     <version>3.1.3.RELEASE</version> 
    </dependency> 
    <dependency> 
     <groupId>org.springframework</groupId> 
     <artifactId>spring-aop</artifactId> 
     <version>3.1.3.RELEASE</version> 
    </dependency> 
    <dependency> 
     <groupId>org.springframework</groupId> 
     <artifactId>spring-asm</artifactId> 
     <version>3.1.3.RELEASE</version> 
    </dependency> 
    <dependency> 
     <groupId>org.springframework</groupId> 
     <artifactId>spring-expression</artifactId> 
     <version>3.1.3.RELEASE</version> 
    </dependency> 
    <dependency> 
     <groupId>org.springframework.security</groupId> 
     <artifactId>spring-security-cas</artifactId> 
     <version>3.1.3.RELEASE</version> 
    </dependency> 

</dependencies> 

回答

10

你張貼的配置有兩個<http>元素,這兩者都不具有pattern屬性,這樣既隱式定義爲匹配所有請求。第二個將覆蓋第一個。

這並不一定解釋爲什麼你看到這條消息(因爲它通常應用於單鏈中的過濾器),但這絕對是一個錯誤。

你也應該刪除auto-config='true',除非你確實知道你想要額外添加的過濾器。

+0

ah..That去除重複元素之後的工作。現在,我的應用程序進入到CAS SSO頁面。但認證後,我得到一個錯誤「此網頁有重定向循環」。我有一個不同的服務器上我的CAS運行。 – Kathir 2013-02-14 18:49:49

相關問題