CAS Single sign on implementation on Spring Security guarded application -


i trying implement cas single sign on in application. application guarded spring security. have put required jars lib folder of application, i'm getting these errors.

>severe: exception starting filter cas gateway filter java.lang.illegalargumentexception: servername or service must set. @ org.jasig.cas.client.util.commonutils.asserttrue(commonutils.java:116)...  >severe: exception starting filter cas validation filter java.lang.illegalargumentexception: casserverurlprefix cannot null. @ org.jasig.cas.client.util.commonutils.assertnotnull(commonutils.java:89)...    >severe: exception starting filter cas renew filter java.lang.illegalargumentexception: servername or service must set. @ org.jasig.cas.client.util.commonutils.asserttrue(commonutils.java:116)...   >severe: exception starting filter cas authentication filter java.lang.illegalargumentexception: servername or service must set. @ org.jasig.cas.client.util.commonutils.asserttrue(commonutils.java:116)... 

anybody please help. tried browsing forums answer, not understand did wrong here.

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 root application context of web app @ 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>      <!-- filter handles single logout request cas server -->     <bean id="singlelogoutfilter"   class="org.jasig.cas.client.session.singlesignoutfilter"/>     <!-- filter redirects cas server signal single logout should      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 more of usual code...

thanks in advance shashi.


Comments

Popular posts from this blog

curl - PHP fsockopen help required -

HTTP/1.0 407 Proxy Authentication Required PHP -

c# - Resource not found error -