Results 1 to 3 of 3

Thread: PersistentTokenBasedRememberMeServices and cookies

Hybrid View

  1. #1
    Join Date
    Nov 2011
    Posts
    8

    Default PersistentTokenBasedRememberMeServices and cookies

    Hey, i need to save the cookie signature of browser when remember me option is actived.

    I have this security configuration:

    Code:
    	<http auto-config="true" use-expressions="true">
    		<intercept-url pattern="/login.do" access="permitAll" />
    		<intercept-url pattern="/account/*.do"
    			access="hasRole('ROLE_USER')
    			and fullyAuthenticated" />
    		<intercept-url pattern="/**" access="hasRole('ROLE_USER')" />
    		<form-login login-page="/login.do" />
    		<logout invalidate-session="true" logout-url="/j_spring_security_logout"
    			logout-success-url="/" />
    			
    		<remember-me key="jbcpPetStore" token-validity-seconds="3600" data-source-ref="dataSource"/>
    
    	</http>
    
    	<authentication-manager alias="authenticationManager">
    		<authentication-provider user-service-ref="jdbcUserServiceCustom">
    			<password-encoder ref="passwordEncoder">
    				<salt-source ref="saltSource"/>
    			</password-encoder>
    		</authentication-provider>
    	</authentication-manager>
    
    	<jdbc:embedded-database id="dataSource" type="HSQL">
    		<jdbc:script location="classpath:security-schema.sql" />
    		<jdbc:script location="classpath:remember-me-schema.sql" />
    		<jdbc:script location="classpath:test-users-groups-data.sql" />
    	</jdbc:embedded-database>
    Before i had implemented my custom TokenBasedRememberMeServices but with persistent mode i can't use the tag services-ref in the remember me element

    I have to implement my custom class to persistent remember me services and extend PersistentTokenBasedRememberMeServices but i dont know how i should make this configuration on xml file and catch the events on LoginSucess and sent cookie to browser.

    Any help? thanks

  2. #2
    Join Date
    Jan 2008
    Posts
    1,834

    Default

    First can you expand on what you are trying to do and why? This might help me or others to help you find the best solution for your problem. You cannot specify both services-ref and data-source-ref because you use one or the other. By specifying the data-source-ref you have stated you want to use PersistentTokenBasedRememberMeServices.
    Rob Winch
    Twitter @rob_winch
    Spring Security Lead
    Spring by Pivotal

  3. #3
    Join Date
    Nov 2011
    Posts
    8

    Default

    Quote Originally Posted by rwinch View Post
    First can you expand on what you are trying to do and why? This might help me or others to help you find the best solution for your problem. You cannot specify both services-ref and data-source-ref because you use one or the other. By specifying the data-source-ref you have stated you want to use PersistentTokenBasedRememberMeServices.
    I am trying to save information on persistent_login on another table but i try with spring classes and when login is with success, any data is inserted in my tablet soo i make a custom TokenBasedRememberMeServices

    - I am using HSQLDB
    - I implemented MyJdbcTokenRepositoryImpl and MyPersistentTokenBasedRememberMeServices

    I put an interceptor to org.springframework.security.web.authentication.re memberme.JdbcTokenRepositoryImpl.createNewToken(.. ) and this is called. I dont know why is called because in my beans declarations, i have declared my custom JdbcTokenRepositoryImpll.

    Any help? tahnks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •