Spring Security with CAS redirect loop -


i've been stumbling last few days on redirect loop when integrating cas sso 1 of web app. happens after i've logged in cas

i've been monitoring requests being exchanged between cas , web app, , seem working.

i suspect problem might come bad implementation of user rights / tokens.

here's file :

<?xml version="1.0" encoding="utf-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:context="http://www.springframework.org/schema/context"     xmlns:sec="http://www.springframework.org/schema/security" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:util="http://www.springframework.org/schema/util"     xsi:schemalocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd         http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd         http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.0.xsd         http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd         http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd">  <bean id="userauditservice" class="net.userauditserviceimpl">         <property name="passwordencoder" ref="passwordencoder" />         <property name="seedgenerator" ref="seedgenerator" />         <property name="canresetpassword" value="${security.resetpassword.enabled}" />     </bean>  <sec:http entry-point-ref="casentrypoint">   <sec:intercept-url pattern="/**" access="role_user"/>    <sec:custom-filter position="cas_filter" ref="casfilter" /> </sec:http>  <bean id="casentrypoint" class="org.springframework.security.cas.web.casauthenticationentrypoint">   <property name="loginurl" value="http://localhost:8080/cas/login" />   <property name="serviceproperties" ref="serviceproperties" /> </bean>  <bean id="serviceproperties" class="org.springframework.security.cas.serviceproperties">         <property name="service" value="http://localhost:8088/myapp/supervision"/>         <property name="sendrenew" value="false"/> </bean>   <bean id="casfilter" class="org.springframework.security.cas.web.casauthenticationfilter">         <property name="authenticationmanager" ref="authenticationmanager"/>         <property name="authenticationsuccesshandler">             <bean                 class="org.springframework.security.web.authentication.savedrequestawareauthenticationsuccesshandler" />         </property>         <property name="filterprocessesurl" value="http://localhost:8088/myapp/supervision"/>  <sec:authentication-manager alias="authenticationmanager">         <sec:authentication-provider ref="casauthenticationprovider" /> </sec:authentication-manager>  <bean id="casauthenticationprovider" class="org.springframework.security.cas.authentication.casauthenticationprovider">         <property name="authenticationuserdetailsservice">             <bean id="authenticationuserdetailsservice" class="net.spauthenticationuserdetailsservice" >                 <constructor-arg ref="userauditservice" />             </bean>         </property>         <property name="serviceproperties" ref="serviceproperties" />         <property name="ticketvalidator">             <bean class="org.jasig.cas.client.validation.cas20serviceticketvalidator">                 <constructor-arg index="0" value="http://localhost:8080/cas" />             </bean>         </property>         <property name="key" value="an_id_for_this_auth_provider_only"/>     </bean>  </beans> 

my authenticationuserdetailsservice class :

public class spauthenticationuserdetailsservice implements authenticationuserdetailsservice {      private final logger logger = loggerfactory.getlogger(getclass());      private userauditservice userauditservice;      public spauthenticationuserdetailsservice(final userauditservice userauditservice) {         this.userauditservice = userauditservice;     }      @override     public userdetails loaduserdetails(authentication token) throws usernamenotfoundexception {         audituser user = userauditservice.findbylogin(token.getname());         logger.info(">> loaduserdetails : user name : " + user.getlogin());         return new userdetailsadapter(user);     } } 

any ideas doing wrong ?

thanks !

(note: should comment can't comment). try cleaning web browser cache, i've had similar trouble in past configuration , bad cache in chrome.


Comments

Popular posts from this blog

How has firefox/gecko HTML+CSS rendering changed in version 38? -

javascript - Complex json ng-repeat -

jquery - Cloning of rows and columns from the old table into the new with colSpan and rowSpan -