0

アプリケーションに CAS シングル サインオンを実装しようとしています。アプリケーションは Spring セキュリティによって保護されています。必要なすべての jar をアプリケーションの lib フォルダーに入れましたが、これらのエラーが発生します。

>SEVERE: Exception starting filter CAS Gateway Filter
java.lang.IllegalArgumentException: serverName or service must be set.
at org.jasig.cas.client.util.CommonUtils.assertTrue(CommonUtils.java:116)...

>SEVERE: Exception starting filter CAS Validation Filter
java.lang.IllegalArgumentException: casServerUrlPrefix cannot be null.
at org.jasig.cas.client.util.CommonUtils.assertNotNull(CommonUtils.java:89)...



>SEVERE: Exception starting filter CAS Renew Filter
java.lang.IllegalArgumentException: serverName or service must be set.
at org.jasig.cas.client.util.CommonUtils.assertTrue(CommonUtils.java:116)...


>SEVERE: Exception starting filter CAS Authentication Filter
java.lang.IllegalArgumentException: serverName or service must be set.
at org.jasig.cas.client.util.CommonUtils.assertTrue(CommonUtils.java:116)...

誰でも助けてください。答えを求めていくつかのフォーラムを閲覧しようとしましたが、ここで何が間違っていたのかわかりません。

web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4">
<display-name>sboffice</display-name>
<!-- Added Spring MVC Dispatcher Servlet -->
<context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>
        /WEB-INF/spring-security.xml
    </param-value>
</context-param>
<filter>
    <filter-name>CAS Authentication Filter</filter-name>
    <filter-class>org.jasig.cas.client.authentication.AuthenticationFilter</filter-class>
    <init-param>
        <param-name>casServerLoginUrl</param-name>
        <param-value>https://arunodaya.localhost:8443/cas/login</param-value>
    </init-param>
    <init-param>
        <param-name>service</param-name>
        <param-value>http://arunodaya.localhost:8080/sboffice/</param-value>
        </init-param>
    <init-param>
        <param-name>serverName</param-name>
        <param-value>http://localhost:8080/</param-value>
    </init-param>
</filter>
<filter>
<filter-name>CAS Validation Filter</filter-name>
<filter-class>org.jasig.cas.client.validation.Cas10TicketValidationFilter</filter-class>
<init-param>
<param-name>casServerUrlPrefix</param-name>
<param-value>https://localhost:8443/cas</param-value>
</init-param>
<init-param>
<param-name>service</param-name>
<param-value>http://arunodaya.localhost:8080/sboffice/</param-value>
</init-param>
<init-param>
<param-name>serverName</param-name>
<param-value>http://localhost:8080/</param-value>
</init-param>
</filter>
<filter>
    <filter-name>CAS HttpServletRequest Wrapper Filter</filter-name>
    <filter-class>org.jasig.cas.client.util.HttpServletRequestWrapperFilter</filter-class>
</filter>
  <filter>
    <filter-name>springSecurityFilterChain</filter-name>
    <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
</filter>
<!--
  - Loads the root application context of this web app at startup.
-->
<listener>
    <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<filter-mapping>
    <filter-name>CAS Authentication Filter</filter-name>
    <url-pattern>/login</url-pattern>
</filter-mapping> 
<filter-mapping>
    <filter-name>CAS Validation Filter</filter-name>
    <url-pattern>/login</url-pattern>
</filter-mapping>
<filter-mapping>
    <filter-name>CAS HttpServletRequest Wrapper Filter</filter-name>
    <url-pattern>/login</url-pattern>
</filter-mapping>
<filter-mapping>
  <filter-name>springSecurityFilterChain</filter-name>
  <url-pattern>/*</url-pattern>
</filter-mapping>
<servlet>
    <servlet-name>springweb</servlet-name>
    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
</servlet>
<welcome-file-list>
    <welcome-file>index.jsp</welcome-file>
</welcome-file-list>

spring-security.xml

<?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:sec="http://www.springframework.org/schema/security"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:aop="http://www.springframework.org/schema/aop"
    xmlns:context="http://www.springframework.org/schema/context"
    xsi:schemaLocation="
    http://www.springframework.org/schema/aop          http://www.springframework.org/schema/aop/spring-aop.xsd
    http://www.springframework.org/schema/context    http://www.springframework.org/schema/context/spring-context.xsd
    http://www.springframework.org/schema/jee    http://www.springframework.org/schema/jee/spring-jee.xsd
    http://www.springframework.org/schema/lang http://www.springframework.org/schema/lang/spring-lang.xsd
    http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd
    http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd
    http://www.springframework.org/schema/mvc
    http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd
    http://www.springframework.org/schema/beans 
    http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
    http://www.springframework.org/schema/security 
    http://www.springframework.org/schema/security/spring-security-3.0.xsd
    ">
<sec:http entry-point-ref="casProcessingFilterEntryPoint" >
<sec:intercept-url pattern="/resources/jsp" access="ROLE_SUPERVISOR" requires-      channel="https"/>
    <sec:logout logout-success-url="https://localhost:8443/cas/logout"/>
    <sec:custom-filter ref="requestSingleLogoutFilter" before="LOGOUT_FILTER"/>
    <sec:custom-filter ref="singleLogoutFilter" before="CAS_FILTER"/>
    <sec:custom-filter ref="casAuthenticationFilter" after="CAS_FILTER"/>
    </sec:http>

    <sec:authentication-manager alias="authenticationManager">
    <sec:authentication-provider ref="casAuthenticationProvider"/>
    </sec:authentication-manager>
<bean id="casAuthenticationFilter"      class="org.springframework.security.cas.web.CasAuthenticationFilter">
    <property name="authenticationManager" ref="authenticationManager"/>
    <property name="authenticationFailureHandler">
        <bean      class="org.springframework.security.web.authentication.SimpleUrlAuthenticationFailureHandler        ">
    <property name="defaultFailureUrl" value="/resources/jsp/index.jsp"/>
    </bean>
    </property>
    <property name="authenticationSuccessHandler">
    <bean       class="org.springframework.security.web.authentication.SimpleUrlAuthenticationSuccessHandler        ">
            <property name="defaultTargetUrl" value="/"/>
        </bean>
    </property>
    <property name="proxyGrantingTicketStorage" ref="proxyGrantingTicketStorage" />
    <property name="proxyReceptorUrl" value="/resources/jsp/receptor" />
    </bean>

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

    <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://localhost:8443/cas" />
            <property name="proxyGrantingTicketStorage" ref="proxyGrantingTicketStorage"      />
<property name="proxyCallbackUrl"        value="https://arunodaya.localhost:8443/sboffice/resources/jsp/receptor" />

     </bean>
</property>
    <property name="key" value="an_id_for_this_auth_provider_only"/>
    </bean>

    <bean id="proxyGrantingTicketStorage"      class="org.jasig.cas.client.proxy.ProxyGrantingTicketStorageImpl" />
    <bean id="serviceProperties"    class="org.springframework.security.cas.ServiceProperties">
    <property name="service"    value="https://arunodaya.localhost:8443/sboffice/j_spring_cas_security_check"/>
    <property name="sendRenew" value="false"/>
    </bean>

    <!-- This filter handles a Single Logout Request from the CAS Server -->
    <bean id="singleLogoutFilter"   class="org.jasig.cas.client.session.SingleSignOutFilter"/>
    <!-- This filter redirects to the CAS Server to signal Single Logout should be      performed       -->
    <bean id="requestSingleLogoutFilter"
    class="org.springframework.security.web.authentication.logout.LogoutFilter">       <constructor-arg value="https://localhost:8443/cas/logout"/>
    <constructor-arg>
    <bean class=
        "org.springframework.security.web.authentication.logout.SecurityContextLogoutHandler"/>
    </constructor-arg>
    <property name="filterProcessesUrl" value="/j_spring_cas_security_logout"/>
    </bean>
<sec:user-service id="userService">
    <sec:user name="jeyakumaran" password="rod" authorities="ROLE_SUPERVISOR,ROLE_USER"   />
    <sec:user name="dianne" password="dianne" authorities="ROLE_USER" />
    <sec:user name="scott" password="scott" authorities="ROLE_USER" />
</sec:user-service>
    </beans>

springweb-servlet.xml は通常のコードです...

よろしくお願いします。

4

0 に答える 0