Java Code Examples for org.springframework.security.web.authentication.rememberme.JdbcTokenRepositoryImpl

The following examples show how to use org.springframework.security.web.authentication.rememberme.JdbcTokenRepositoryImpl. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
/**
 * 记住我功能的token存取器配置
 */
@Bean
public PersistentTokenRepository persistentTokenRepository() {
	JdbcTokenRepositoryImpl tokenRepository = new JdbcTokenRepositoryImpl();
	tokenRepository.setDataSource(dataSource);
	return tokenRepository;
}
 
Example 2
Source Project: fw-spring-cloud   Source File: SecurityConfig.java    License: Apache License 2.0 5 votes vote down vote up
@Bean
    public PersistentTokenRepository persistentTokenRepository() {
        JdbcTokenRepositoryImpl tokenRepository = new JdbcTokenRepositoryImpl();
        tokenRepository.setDataSource(dataSource);
//        tokenRepository.setCreateTableOnStartup(true);
        return tokenRepository;
    }
 
Example 3
@Bean
public PersistentTokenRepository persistentTokenRepository() {
    JdbcTokenRepositoryImpl jdbcTokenRepository = new JdbcTokenRepositoryImpl();
    jdbcTokenRepository.setCreateTableOnStartup(false);
    jdbcTokenRepository.setDataSource(dataSource);
    return jdbcTokenRepository;
}
 
Example 4
/**
 * 记住我功能的token存取器配置
 */
@Bean
public PersistentTokenRepository persistentTokenRepository() {
	JdbcTokenRepositoryImpl tokenRepository = new JdbcTokenRepositoryImpl();
	tokenRepository.setDataSource(dataSource);
	return tokenRepository;
}
 
Example 5
Source Project: blog-sample   Source File: WebSecurityConfig.java    License: Apache License 2.0 5 votes vote down vote up
@Bean
    public PersistentTokenRepository persistentTokenRepository() {
        JdbcTokenRepositoryImpl tokenRepository = new JdbcTokenRepositoryImpl();
        tokenRepository.setDataSource(dataSource);
        // 如果token表不存在,使用下面语句可以初始化该表;若存在,会报错。
//        tokenRepository.setCreateTableOnStartup(true);
        return tokenRepository;
    }
 
Example 6
Source Project: blog-sample   Source File: WebSecurityConfig.java    License: Apache License 2.0 5 votes vote down vote up
@Bean
public PersistentTokenRepository persistentTokenRepository(){
    JdbcTokenRepositoryImpl tokenRepository = new JdbcTokenRepositoryImpl();
    tokenRepository.setDataSource(dataSource);
    // 如果token表不存在,使用下面语句可以初始化该表;若存在,会报错。
    //tokenRepository.setCreateTableOnStartup(true);
    return tokenRepository;
}
 
Example 7
Source Project: blog-sample   Source File: WebSecurityConfig.java    License: Apache License 2.0 5 votes vote down vote up
@Bean
    public PersistentTokenRepository persistentTokenRepository() {
        JdbcTokenRepositoryImpl tokenRepository = new JdbcTokenRepositoryImpl();
        tokenRepository.setDataSource(dataSource);
        // 如果token表不存在,使用下面语句可以初始化该表;若存在,会报错。
//        tokenRepository.setCreateTableOnStartup(true);
        return tokenRepository;
    }
 
Example 8
Source Project: blog-sample   Source File: WebSecurityConfig.java    License: Apache License 2.0 5 votes vote down vote up
/**
     * token 持久化
     */
    @Bean
    public PersistentTokenRepository persistentTokenRepository(){
        JdbcTokenRepositoryImpl tokenRepository = new JdbcTokenRepositoryImpl();
        tokenRepository.setDataSource(dataSource);
        // 如果token表不存在,使用下面语句可以初始化该表;若存在,会报错。
//        tokenRepository.setCreateTableOnStartup(true);
        return tokenRepository;
    }
 
Example 9
Source Project: blog-sample   Source File: WebSecurityConfig.java    License: Apache License 2.0 5 votes vote down vote up
/**
     * token 持久化
     */
    @Bean
    public PersistentTokenRepository persistentTokenRepository(){
        JdbcTokenRepositoryImpl tokenRepository = new JdbcTokenRepositoryImpl();
        tokenRepository.setDataSource(dataSource);
        // 如果token表不存在,使用下面语句可以初始化该表;若存在,会报错。
//        tokenRepository.setCreateTableOnStartup(true);
        return tokenRepository;
    }
 
Example 10
Source Project: blog-sample   Source File: WebSecurityConfig.java    License: Apache License 2.0 5 votes vote down vote up
@Bean
    public PersistentTokenRepository persistentTokenRepository() {
        JdbcTokenRepositoryImpl tokenRepository = new JdbcTokenRepositoryImpl();
        tokenRepository.setDataSource(dataSource);
        // 如果token表不存在,使用下面语句可以初始化该表;若存在,会报错。
//        tokenRepository.setCreateTableOnStartup(true);
        return tokenRepository;
    }
 
Example 11
Source Project: blog-sample   Source File: WebSecurityConfig.java    License: Apache License 2.0 5 votes vote down vote up
@Bean
    public PersistentTokenRepository persistentTokenRepository() {
        JdbcTokenRepositoryImpl tokenRepository = new JdbcTokenRepositoryImpl();
        tokenRepository.setDataSource(dataSource);
        // 如果token表不存在,使用下面语句可以初始化该表;若存在,会报错。
//        tokenRepository.setCreateTableOnStartup(true);
        return tokenRepository;
    }
 
Example 12
Source Project: jvue-admin   Source File: WebSecurityConfig.java    License: MIT License 5 votes vote down vote up
@Bean
public PersistentTokenRepository tokenRepository() {
	JdbcTokenRepositoryImpl jdbcTokenRepositoryImpl = new JdbcTokenRepositoryImpl();
	jdbcTokenRepositoryImpl.setDataSource(dataSource);
	// jdbcTokenRepositoryImpl.setCreateTableOnStartup(true);
	return jdbcTokenRepositoryImpl;
}
 
Example 13
Source Project: paascloud-master   Source File: PcResourceServerConfig.java    License: Apache License 2.0 5 votes vote down vote up
/**
	 * 记住我功能的token存取器配置
	 *
	 * @return the persistent token repository
	 */
	@Bean
	public PersistentTokenRepository persistentTokenRepository() {
		JdbcTokenRepositoryImpl tokenRepository = new JdbcTokenRepositoryImpl();
		tokenRepository.setDataSource(dataSource);
//		tokenRepository.setCreateTableOnStartup(true); // 第一次启动创建
		return tokenRepository;
	}
 
Example 14
Source Project: FEBS-Security   Source File: FebsSecurityConfig.java    License: Apache License 2.0 5 votes vote down vote up
@Bean
public PersistentTokenRepository persistentTokenRepository() {
    JdbcTokenRepositoryImpl jdbcTokenRepository = new JdbcTokenRepositoryImpl();
    jdbcTokenRepository.setDataSource(dataSource);
    jdbcTokenRepository.setCreateTableOnStartup(false);
    return jdbcTokenRepository;
}
 
Example 15
Source Project: SpringAll   Source File: BrowserSecurityConfig.java    License: MIT License 5 votes vote down vote up
@Bean
public PersistentTokenRepository persistentTokenRepository() {
    JdbcTokenRepositoryImpl jdbcTokenRepository = new JdbcTokenRepositoryImpl();
    jdbcTokenRepository.setDataSource(dataSource);
    jdbcTokenRepository.setCreateTableOnStartup(false);
    return jdbcTokenRepository;
}
 
Example 16
Source Project: danyuan-application   Source File: WebSecurityConfig.java    License: Apache License 2.0 5 votes vote down vote up
@Bean
public PersistentTokenRepository tokenRepository() {
	JdbcTokenRepositoryImpl jdbcTokenRepository = new JdbcTokenRepositoryImpl();
	jdbcTokenRepository.setDataSource(dataSource);
	// 设置为true,则项目启动时,会在对应数据源中自动建表token表
	jdbcTokenRepository.setCreateTableOnStartup(false);
	return jdbcTokenRepository;
}
 
Example 17
Source Project: imooc-security   Source File: BrowserSecurityConfig.java    License: Apache License 2.0 5 votes vote down vote up
@Bean
    public PersistentTokenRepository persistentTokenRepository(){
        JdbcTokenRepositoryImpl tokenRepository = new JdbcTokenRepositoryImpl();
        tokenRepository.setDataSource(dataSource);
//        tokenRepository.setCreateTableOnStartup(true);
        return tokenRepository;
    }
 
Example 18
@Bean
public PersistentTokenRepository jdbcTokenRepository() {
	JdbcTokenRepositoryImpl repository = new JdbcTokenRepositoryImpl();
	repository.setCreateTableOnStartup(false);
	repository.setDataSource(dataSource);			
	return repository;
}
 
Example 19
@Bean
public RememberMeServices getRememberMeServices() {
	JdbcUserDetailsManager jdbcUserDetailsManager = new JdbcUserDetailsManager();
	jdbcUserDetailsManager.setDataSource(dataSource);

	JdbcTokenRepositoryImpl jdbcTokenRepositoryImpl = new JdbcTokenRepositoryImpl();
	jdbcTokenRepositoryImpl.setDataSource(dataSource);

	PersistentTokenBasedRememberMeServices services = new PersistentTokenBasedRememberMeServices(
			rememberMeToken, jdbcUserDetailsManager, jdbcTokenRepositoryImpl);
	services.setParameter(rememberMeParameter);
	return services;
}
 
Example 20
Source Project: base-admin   Source File: LoginSuccessHandlerConfig.java    License: MIT License 4 votes vote down vote up
@Bean
public PersistentTokenRepository persistentTokenRepository1() {
    JdbcTokenRepositoryImpl persistentTokenRepository = new JdbcTokenRepositoryImpl();
    persistentTokenRepository.setDataSource(dataSource);
    return persistentTokenRepository;
}
 
Example 21
@Bean
public PersistentTokenRepository persistentTokenRepository() {
    JdbcTokenRepositoryImpl jdbcTokenRepository = new JdbcTokenRepositoryImpl();
    jdbcTokenRepository.setCreateTableOnStartup(false);
    return jdbcTokenRepository;
}
 
Example 22
Source Project: Taroco   Source File: WebSecurityConfigration.java    License: Apache License 2.0 4 votes vote down vote up
/**
 * RememberMeServices
 */
public RememberMeServices rememberMeServices() {
    final JdbcTokenRepositoryImpl tokenRepository = new JdbcTokenRepositoryImpl();
    tokenRepository.setDataSource(dataSource);
    return new PersistentTokenBasedRememberMeServices(RM_KEY, userNameUserDetailsService, tokenRepository);
}
 
Example 23
public PersistentTokenRepository persistentTokenRepository() {
    JdbcTokenRepositoryImpl repo = new JdbcTokenRepositoryImpl();
    repo.setDataSource(dataSource());
    return repo;
}
 
Example 24
public PersistentTokenRepository persistentTokenRepository() {
    JdbcTokenRepositoryImpl repo = new JdbcTokenRepositoryImpl();
    repo.setDataSource(dataSource());
    return repo;
}
 
Example 25
Source Project: QuizZz   Source File: SecurityConfig.java    License: MIT License 4 votes vote down vote up
@Bean
public PersistentTokenRepository persistentTokenRepository() {
	JdbcTokenRepositoryImpl db = new JdbcTokenRepositoryImpl();
	db.setDataSource(dataSource);
	return db;
}
 
Example 26
@Bean
public PersistentTokenRepository persistentTokenRepository() {
    JdbcTokenRepositoryImpl jdbcTokenRepositoryImpl = new JdbcTokenRepositoryImpl();
    jdbcTokenRepositoryImpl.setDataSource(dataSource);
    return jdbcTokenRepositoryImpl;
}
 
Example 27
Source Project: wallride   Source File: WallRideSecurityConfiguration.java    License: Apache License 2.0 4 votes vote down vote up
@Bean
public PersistentTokenRepository persistentTokenRepository() {
	JdbcTokenRepositoryImpl repository = new JdbcTokenRepositoryImpl();
	repository.setDataSource(dataSource);
	return repository;
}
 
Example 28
Source Project: Spring   Source File: SecurityConfig.java    License: Apache License 2.0 3 votes vote down vote up
/**
 * Save data to db table
 *
 * Default SQL for creating the database table to store the tokens
 * public static final String CREATE_TABLE_SQL = "create table persistent_logins (username varchar(64) not null, series varchar(64) primary key, "
 *		+ "token varchar(64) not null, last_used timestamp not null)";
 */
@Bean
public PersistentTokenRepository persistentTokenRepository() {
	final JdbcTokenRepositoryImpl  db = new JdbcTokenRepositoryImpl();
	db.setDataSource(dataSource);
	return db;
}