Java 类org.springframework.security.web.authentication.rememberme.PersistentTokenRepository 实例源码

项目:REST-Web-Services    文件:WebSecurityConfig.java   
/**
 * Used to store the persistent login tokens for a user.
 */
@Bean
public PersistentTokenRepository persistentTokenRepository() {
    final JdbcTokenRepositoryImpl impl = new JdbcTokenRepositoryImpl();
    impl.setDataSource(dataSource);
    return impl;
}
项目:springuni-particles    文件:AuthSecurityConfiguration.java   
@Override
protected void customizeRememberMe(HttpSecurity http) throws Exception {
  UserDetailsService userDetailsService = lookup("userDetailsService");
  PersistentTokenRepository persistentTokenRepository = lookup("persistentTokenRepository");
  AbstractRememberMeServices rememberMeServices = lookup("rememberMeServices");
  RememberMeAuthenticationFilter rememberMeAuthenticationFilter =
      lookup("rememberMeAuthenticationFilter");

  http.rememberMe()
      .userDetailsService(userDetailsService)
      .tokenRepository(persistentTokenRepository)
      .rememberMeServices(rememberMeServices)
      .key(rememberMeServices.getKey())
      .and()
      .logout()
      .logoutUrl(LOGOUT_ENDPOINT)
      .and()
      .addFilterAt(rememberMeAuthenticationFilter, RememberMeAuthenticationFilter.class);
}
项目:Sound.je    文件:WebSecurityConfig.java   
/**
 * Persistent token repository persistent token repository.
 *
 * @return the persistent token repository
 */
@Bean
public PersistentTokenRepository persistentTokenRepository() {
    JdbcTokenRepositoryImpl jdbcTokenRepository = new JdbcTokenRepositoryImpl();
    jdbcTokenRepository.setDataSource(dataSource);
    return jdbcTokenRepository;
}
项目:springuni-particles    文件:AuthSecurityConfiguration.java   
@Bean
public RememberMeServices rememberMeServices(
    UserDetailsService userDetailsService, PersistentTokenRepository persistentTokenRepository) {

  String secretKey = getRememberMeTokenSecretKey().orElseThrow(IllegalStateException::new);

  return new PersistentJwtTokenBasedRememberMeServices(
      secretKey, userDetailsService, persistentTokenRepository);
}
项目:pathological-reports    文件:SecurityConfiguration.java   
@Bean
public PersistentTokenRepository persistentTokenRepository() {
    JdbcTokenRepositoryImpl db = new JdbcTokenRepositoryImpl();
    db.setDataSource(dataSource);

    return db;
}
项目:hockey-game    文件:SecurityConfiguration.java   
@Bean
public PersistentTokenRepository persistentTokenRepository() {
    JdbcTokenRepositoryImpl db = new JdbcTokenRepositoryImpl();
    db.setDataSource(dataSource);

    return db;
}
项目:judge    文件:TokenRepositoryConfiguration.java   
@Bean
public PersistentTokenRepository persistentTokenRepository(JdbcTemplate jdbcTemplate) {
    JdbcTokenRepositoryImpl jdbcTokenRepositoryImpl = new JdbcTokenRepositoryImpl();
    jdbcTokenRepositoryImpl.setJdbcTemplate(jdbcTemplate);
    jdbcTokenRepositoryImpl.setCreateTableOnStartup(false);
    return jdbcTokenRepositoryImpl;
}
项目:web-harvester    文件:WebSecurityConfiguration.java   
private static HttpSecurity protect(String path, String role, HttpSecurity security,
        PersistentTokenRepository tokenRepository) throws Exception {
    return security.antMatcher(format("%s/**", path)).authorizeRequests().anyRequest().hasAnyAuthority(role)
            .and().formLogin().loginPage(format("%s/login", path)).passwordParameter("lg_mrg_pwddw").usernameParameter("lg_mrg_usdfer").permitAll()
            .and().logout().logoutUrl(format("%s/logout", path)).permitAll()
            .and().csrf()
            .and().rememberMe().tokenRepository(tokenRepository).tokenValiditySeconds(1209600).and();

}
项目:springfield    文件:PersistentTokenRepositoryDetector.java   
@Override
public void afterPropertiesSet() throws Exception {
    try{
        Map<String,?> beans = applicationContext.getBeansOfType(PersistentTokenRepository.class);

        if (beans.size() == 0) {
            throw new ApplicationContextException("No PersistentTokenRepository registered.");
        } else if (beans.size() > 1) {
            throw new ApplicationContextException("More than one PersistentTokenRepository registered.");
        }
        this.tokenRepository = (PersistentTokenRepository) beans.values().toArray()[0];
    }catch(Exception e){
    }
}
项目:Vaadin4Spring-MVP-Sample-SpringSecurity    文件:SecurityConfig.java   
@Bean
public PersistentTokenRepository jdbcTokenRepository() {
    JdbcTokenRepositoryImpl repository = new JdbcTokenRepositoryImpl();
    repository.setCreateTableOnStartup(false);
    repository.setDataSource(dataSource);           
    return repository;
}
项目:maven-framework-project    文件:IpAwarePersistentTokenRepository.java   
/**
 * Creates a new {@link IpAwarePersistentTokenRepository} that after converting the seriesId to contain the current
 * user's IP address will use the delegateRepository to do all the work.
 *
 * @param delegateRepository
 */
public IpAwarePersistentTokenRepository(PersistentTokenRepository delegateRepository) {
    if (delegateRepository == null) {
        throw new IllegalArgumentException("delegateRepository cannot be null");
    }
    this.delegateRepository = delegateRepository;
}
项目:leafer    文件:WebSecurityConfig.java   
@Bean
public PersistentTokenRepository persistentTokenRepository() {
    JdbcTokenRepositoryImpl tokenRepository = new JdbcTokenRepositoryImpl();
    tokenRepository.setDataSource(dataSource);
    return tokenRepository;
}
项目:springuni-particles    文件:PersistentJwtTokenBasedRememberMeServices.java   
public PersistentJwtTokenBasedRememberMeServices(
    String key, UserDetailsService userDetailsService,
    PersistentTokenRepository tokenRepository) {

  super(key, userDetailsService, tokenRepository);
}
项目:springuni-particles    文件:AuthSecurityConfiguration.java   
@Bean
public PersistentTokenRepository persistentTokenRepository(SessionService sessionService) {
  return new DelegatingPersistentTokenRepository(sessionService);
}
项目:QuizZz    文件:SecurityConfig.java   
@Bean
public PersistentTokenRepository persistentTokenRepository() {
    JdbcTokenRepositoryImpl db = new JdbcTokenRepositoryImpl();
    db.setDataSource(dataSource);
    return db;
}
项目:AntiSocial-Platform    文件:SecurityConfiguration.java   
@Bean
public PersistentTokenRepository persistentTokenRepository(){
    JdbcTokenRepositoryImpl tokenRepository = new JdbcTokenRepositoryImpl();
    tokenRepository.setDataSource(dataSource);
    return tokenRepository;
}
项目:AntiSocial-Platform    文件:SecurityConfiguration.java   
@Bean
public PersistentTokenRepository persistentTokenRepository(){
    JdbcTokenRepositoryImpl tokenRepository = new JdbcTokenRepositoryImpl();
    tokenRepository.setDataSource(dataSource);
    return tokenRepository;
}
项目:spring-security-basics    文件:SecurityConfig.java   
@Bean
public PersistentTokenRepository persistentTokenRepository() {
    final JdbcTokenRepositoryImpl jdbcTokenRepositoryImpl = new JdbcTokenRepositoryImpl();
    jdbcTokenRepositoryImpl.setDataSource(dataSource);
    return jdbcTokenRepositoryImpl;
}
项目:redflags    文件:SecurityRoles.java   
private PersistentTokenRepository persistentTokenRepository() {
    JdbcTokenRepositoryImpl tr = new JdbcTokenRepositoryImpl();
    tr.setJdbcTemplate(jdbc);
    return tr;
}
项目:notedown    文件:WebSecurityConfiguration.java   
@Bean
public PersistentTokenRepository persistentTokenRepository() {
    JdbcTokenRepositoryImpl repo = new JdbcTokenRepositoryImpl();
    repo.setDataSource(dataSource);
    return repo;
}
项目:kayura-uasp    文件:PersistentRememberMeServices.java   
public PersistentRememberMeServices(String key, UserDetailsService userDetailsService,
        PersistentTokenRepository tokenRepository) {
    super(key, userDetailsService);
    random = new SecureRandom();
    this.tokenRepository = tokenRepository;
}
项目:ws_hcm    文件:SecurityConfiguration.java   
@Bean
public PersistentTokenRepository persistentTokenRepository() {
    return new RememberMeTokenServiceImpl(rememberMeTokenRepository);
}
项目:summerb    文件:PersistentTokenBasedRememberMeServicesEx.java   
public PersistentTokenBasedRememberMeServicesEx(String key, UserDetailsService userDetailsService,
        PersistentTokenRepository tokenRepository) {
    super(key, userDetailsService, tokenRepository);
}
项目:grassroot-platform    文件:SecurityConfig.java   
@Bean
public PersistentTokenRepository persistentTokenRepository() {
    JdbcTokenRepositoryImpl db = new JdbcTokenRepositoryImpl();
    db.setDataSource(dataSource);
    return db;
}
项目:notedown    文件:WebSecurityConfiguration.java   
@Bean
public PersistentTokenRepository persistentTokenRepository() {
    JdbcTokenRepositoryImpl repo = new JdbcTokenRepositoryImpl();
    repo.setDataSource(dataSource);
    return repo;
}
项目:Vaadin4Spring-MVP-Sample-SpringSecurity    文件:VaadinPersistentTokenBasedRememberMeServices.java   
public VaadinPersistentTokenBasedRememberMeServices(String key,
        UserDetailsService userDetailsService,
        PersistentTokenRepository tokenRepository) {        
    super(key, userDetailsService, tokenRepository);
}
项目:JiwhizBlogWeb    文件:SecurityConfig.java   
@Bean 
public PersistentTokenRepository persistentTokenRepository() {
    return new MongoPersistentTokenRepositoryImpl(rememberMeTokenRepository);
}
项目:springsecuredthymeleafapp    文件:SecurityConfiguration.java   
/**
 * <p>persistentTokenRepository.</p>
 *
 * @return a {@link org.springframework.security.web.authentication.rememberme.PersistentTokenRepository} object.
 */
@Bean
public PersistentTokenRepository persistentTokenRepository() {
    return new MongoPersistentTokenRepositoryImpl(rememberMeTokenRepository);
}