Announcement Announcement Module
Collapse
No announcement yet.
spring Security With CAS Single Sign On Page Title Module
Move Remove Collapse
This topic is closed
X
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • spring Security With CAS Single Sign On

    I trying for single sign on in spring security with CAS.

    I install CAS in my tomcat and configured spring security
    Its not triggering any error dnd its not showing login page.
    Please suggest me the solution .
    Thanks in advance
    Following are my Spring security XML file .
    Code:
    <?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"
           xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
                                                    http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-2.0.xsd">
     
        <sec:http lowercase-comparisons="false" entry-point-ref="casProcessingFilterEntryPoint">
            
            <sec:intercept-url pattern="/403.jsp" filters="none"/>
            <sec:intercept-url pattern="/404.jsp" filters="none"/>
            <sec:intercept-url pattern="/error.jsp" filters="none"/>
            <sec:intercept-url pattern="/**"
                               access="ROLE_USER"
                               requires-channel="http"/>
            <sec:logout logout-success-url="http://localhost:9090/cas/logout" invalidate-session="false"/>
           
        </sec:http>
     
        <bean id="passwordEncoder" class="org.springframework.security.providers.encoding.ShaPasswordEncoder"/>
     
        <!-- where do I go when I need authentication -->
        <bean id="casProcessingFilterEntryPoint" class="org.springframework.security.ui.cas.CasProcessingFilterEntryPoint">
            <property name="loginUrl" value="https://localhost:9090/cas/login"/>
            <property name="serviceProperties" ref="serviceProperties"/>
        </bean>
     
        <!-- which service (application) am I authenticating -->
        <bean id="serviceProperties" class="org.springframework.security.ui.cas.ServiceProperties">
            <property name="service" value="http://localhost:9090/SOA/j_spring_cas_security_check"/>
            <property name="sendRenew" value="false"/>
        </bean>
     
        <sec:authentication-manager alias="authenticationManager"/>
     
        <bean id="casSingleSignOutFilter" class="org.jasig.cas.client.session.SingleSignOutFilter">
            <sec:custom-filter before="CAS_PROCESSING_FILTER"/>
        </bean>
     
        <bean id="casProcessingFilter" class="org.springframework.security.ui.cas.CasProcessingFilter">
            <sec:custom-filter after="CAS_PROCESSING_FILTER"/>
            <property name="authenticationManager" ref="authenticationManager"/>
            <property name="authenticationFailureUrl" value="/403.jsp"/>
            <property name="defaultTargetUrl" value="/"/>       
        </bean>
     
        <bean id="casAuthenticationProvider" class="org.springframework.security.providers.cas.CasAuthenticationProvider">
            <sec:custom-authentication-provider/>
            <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:9090/cas"/>
                </bean>
            </property>
             <property name="key" value="joe"/>
        </bean>
     
        <!-- Log failed authentication attempts to commons-logging -->
        <bean id="loggerListener" class="org.springframework.security.event.authentication.LoggerListener"/>
     <sec:user-service id="userService">
        <sec:user name="joe" password="joe" authorities="ROLE_USER" />
        
      </sec:user-service>
     
    </beans>

  • #2
    I forget to update filter in web.xml

    for time being problem has been solved.
    Code:
    <filter>
            <filter-name>springSecurityFilterChain</filter-name>
            <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
        </filter>
        
        <filter-mapping>
            <filter-name>springSecurityFilterChain</filter-name>
            <url-pattern>/*</url-pattern>
        </filter-mapping>

    Comment


    • #3
      Halo Sony, I have same problem too, I'm new in CAS... have tried your spring-security.xml for integrated with CAS..but still no success can you give me overall sample your web.xml ? is there any step by step tutorial to integrated existing Spring Security with CAS? needing answer. thank you before.


      Regards

      Comment


      • #4
        FYI...there is a complete cas sample included with Spring Security.

        Comment


        • #5
          hi mike,
          Whats problem you are getting . Are you able login in CAS?
          First step is that if any difficulty please let me know.

          I just followed the CAS tutorials.

          Comment

          Working...
          X