org.springframework.security.web.authentication.rememberme.PersistentTokenRepository Java Examples

The following examples show how to use org.springframework.security.web.authentication.rememberme.PersistentTokenRepository. 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
Source File: SecurityConfig.java    From fw-spring-cloud with 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 #2
Source File: IpAwarePersistentTokenRepository.java    From maven-framework-project with MIT License 5 votes vote down vote up
/**
 * 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;
}
 
Example #3
Source File: SecurityConfig.java    From Vaadin4Spring-MVP-Sample-SpringSecurity with Apache License 2.0 5 votes vote down vote up
@Bean
public PersistentTokenRepository jdbcTokenRepository() {
	JdbcTokenRepositoryImpl repository = new JdbcTokenRepositoryImpl();
	repository.setCreateTableOnStartup(false);
	repository.setDataSource(dataSource);			
	return repository;
}
 
Example #4
Source File: BrowserSecurityConfig.java    From imooc-security with 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 #5
Source File: WebSecurityConfig.java    From danyuan-application with 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 #6
Source File: BrowserSecurityConfig.java    From SpringAll with 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 #7
Source File: FebsSecurityConfig.java    From FEBS-Security with 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 #8
Source File: PcResourceServerConfig.java    From paascloud-master with 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 #9
Source File: WebSecurityConfig.java    From jvue-admin with 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 #10
Source File: WebSecurityConfig.java    From blog-sample with 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 File: WebSecurityConfig.java    From blog-sample with 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 File: WebSecurityConfig.java    From blog-sample with 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 #13
Source File: WebSecurityConfig.java    From blog-sample with 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 #14
Source File: WebSecurityConfig.java    From blog-sample with 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 #15
Source File: WebSecurityConfig.java    From blog-sample with 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 #16
Source File: WebSecurityConfig.java    From blog-sample with 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 #17
Source File: OauthWebServerSecurityConfig.java    From codeway_service with GNU General Public License v3.0 5 votes vote down vote up
/**
 * 记住我功能的token存取器配置
 */
@Bean
public PersistentTokenRepository persistentTokenRepository() {
	JdbcTokenRepositoryImpl tokenRepository = new JdbcTokenRepositoryImpl();
	tokenRepository.setDataSource(dataSource);
	return tokenRepository;
}
 
Example #18
Source File: OauthWebServerSecurityConfig.java    From codeway_service with GNU General Public License v3.0 5 votes vote down vote up
/**
 * 记住我功能的token存取器配置
 */
@Bean
public PersistentTokenRepository persistentTokenRepository() {
	JdbcTokenRepositoryImpl tokenRepository = new JdbcTokenRepositoryImpl();
	tokenRepository.setDataSource(dataSource);
	return tokenRepository;
}
 
Example #19
Source File: DunwuSecurityConfiguration.java    From spring-boot-tutorial with Creative Commons Attribution Share Alike 4.0 International 5 votes vote down vote up
@Bean
public PersistentTokenRepository persistentTokenRepository() {
    JdbcTokenRepositoryImpl jdbcTokenRepository = new JdbcTokenRepositoryImpl();
    jdbcTokenRepository.setCreateTableOnStartup(false);
    jdbcTokenRepository.setDataSource(dataSource);
    return jdbcTokenRepository;
}
 
Example #20
Source File: SecurityConfig.java    From JiwhizBlogWeb with Apache License 2.0 4 votes vote down vote up
@Bean 
public PersistentTokenRepository persistentTokenRepository() {
    return new MongoPersistentTokenRepositoryImpl(rememberMeTokenRepository);
}
 
Example #21
Source File: VaadinPersistentTokenBasedRememberMeServices.java    From Vaadin4Spring-MVP-Sample-SpringSecurity with Apache License 2.0 4 votes vote down vote up
public VaadinPersistentTokenBasedRememberMeServices(String key,
		UserDetailsService userDetailsService,
		PersistentTokenRepository tokenRepository) {		
	super(key, userDetailsService, tokenRepository);
}
 
Example #22
Source File: LoginSuccessHandlerConfig.java    From base-admin with MIT License 4 votes vote down vote up
@Bean
public PersistentTokenRepository persistentTokenRepository1() {
    JdbcTokenRepositoryImpl persistentTokenRepository = new JdbcTokenRepositoryImpl();
    persistentTokenRepository.setDataSource(dataSource);
    return persistentTokenRepository;
}
 
Example #23
Source File: WallRideSecurityConfiguration.java    From wallride with Apache License 2.0 4 votes vote down vote up
@Bean
public PersistentTokenRepository persistentTokenRepository() {
	JdbcTokenRepositoryImpl repository = new JdbcTokenRepositoryImpl();
	repository.setDataSource(dataSource);
	return repository;
}
 
Example #24
Source File: WebSecurityConfig.java    From fredbet with Creative Commons Attribution Share Alike 4.0 International 4 votes vote down vote up
@Bean
public PersistentTokenRepository persistentTokenRepository() {
    JdbcTokenRepositoryImpl jdbcTokenRepositoryImpl = new JdbcTokenRepositoryImpl();
    jdbcTokenRepositoryImpl.setDataSource(dataSource);
    return jdbcTokenRepositoryImpl;
}
 
Example #25
Source File: SecurityConfig.java    From QuizZz with MIT License 4 votes vote down vote up
@Bean
public PersistentTokenRepository persistentTokenRepository() {
	JdbcTokenRepositoryImpl db = new JdbcTokenRepositoryImpl();
	db.setDataSource(dataSource);
	return db;
}
 
Example #26
Source File: SecurityConfig.java    From springboot-vue.js-bbs with Apache License 2.0 4 votes vote down vote up
public SecurityConfig(UserDetailsService customUserDetailsService, PersistentTokenRepository persistentTokenRepository) {
    this.userDetailsService = customUserDetailsService;
    this.persistentTokenRepository = persistentTokenRepository;
}
 
Example #27
Source File: DunwuSecurityConfig.java    From spring-boot-tutorial with Creative Commons Attribution Share Alike 4.0 International 4 votes vote down vote up
@Bean
public PersistentTokenRepository persistentTokenRepository() {
    JdbcTokenRepositoryImpl jdbcTokenRepository = new JdbcTokenRepositoryImpl();
    jdbcTokenRepository.setCreateTableOnStartup(false);
    return jdbcTokenRepository;
}
 
Example #28
Source File: SecurityConfig.java    From Spring5Tutorial with GNU Lesser General Public License v3.0 4 votes vote down vote up
public PersistentTokenRepository persistentTokenRepository() {
    JdbcTokenRepositoryImpl repo = new JdbcTokenRepositoryImpl();
    repo.setDataSource(dataSource());
    return repo;
}
 
Example #29
Source File: SecurityConfig.java    From Spring5Tutorial with GNU Lesser General Public License v3.0 4 votes vote down vote up
public PersistentTokenRepository persistentTokenRepository() {
    JdbcTokenRepositoryImpl repo = new JdbcTokenRepositoryImpl();
    repo.setDataSource(dataSource());
    return repo;
}
 
Example #30
Source File: SecurityConfig.java    From Spring with 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;
}