Search in sources :

Example 1 with PersistentTokenBasedRememberMeServices

use of org.springframework.security.web.authentication.rememberme.PersistentTokenBasedRememberMeServices in project spring-security by spring-projects.

the class PersistentTokenBasedRememberMeServicesTests method setUpData.

@Before
public void setUpData() throws Exception {
    services = new PersistentTokenBasedRememberMeServices("key", new AbstractRememberMeServicesTests.MockUserDetailsService(AbstractRememberMeServicesTests.joe, false), new InMemoryTokenRepositoryImpl());
    services.setCookieName("mycookiename");
    // Default to 100 days (see SEC-1081).
    services.setTokenValiditySeconds(100 * 24 * 60 * 60);
    services.afterPropertiesSet();
}
Also used : PersistentTokenBasedRememberMeServices(org.springframework.security.web.authentication.rememberme.PersistentTokenBasedRememberMeServices) Before(org.junit.Before)

Example 2 with PersistentTokenBasedRememberMeServices

use of org.springframework.security.web.authentication.rememberme.PersistentTokenBasedRememberMeServices in project spring-security by spring-projects.

the class PersistentTokenBasedRememberMeServicesTests method create.

private PersistentTokenBasedRememberMeServices create(PersistentRememberMeToken token) {
    repo = new MockTokenRepository(token);
    PersistentTokenBasedRememberMeServices services = new PersistentTokenBasedRememberMeServices("key", new AbstractRememberMeServicesTests.MockUserDetailsService(AbstractRememberMeServicesTests.joe, false), repo);
    services.setCookieName("mycookiename");
    return services;
}
Also used : PersistentTokenBasedRememberMeServices(org.springframework.security.web.authentication.rememberme.PersistentTokenBasedRememberMeServices)

Aggregations

PersistentTokenBasedRememberMeServices (org.springframework.security.web.authentication.rememberme.PersistentTokenBasedRememberMeServices)2 Before (org.junit.Before)1