当前位置: 首页>>代码示例>>Java>>正文


Java PersistentTokenRepository类代码示例

本文整理汇总了Java中org.springframework.security.web.authentication.rememberme.PersistentTokenRepository的典型用法代码示例。如果您正苦于以下问题:Java PersistentTokenRepository类的具体用法?Java PersistentTokenRepository怎么用?Java PersistentTokenRepository使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


PersistentTokenRepository类属于org.springframework.security.web.authentication.rememberme包,在下文中一共展示了PersistentTokenRepository类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: persistentTokenRepository

import org.springframework.security.web.authentication.rememberme.PersistentTokenRepository; //导入依赖的package包/类
/**
 * Used to store the persistent login tokens for a user.
 */
@Bean
public PersistentTokenRepository persistentTokenRepository() {
    final JdbcTokenRepositoryImpl impl = new JdbcTokenRepositoryImpl();
    impl.setDataSource(dataSource);
    return impl;
}
 
开发者ID:JonkiPro,项目名称:REST-Web-Services,代码行数:10,代码来源:WebSecurityConfig.java

示例2: customizeRememberMe

import org.springframework.security.web.authentication.rememberme.PersistentTokenRepository; //导入依赖的package包/类
@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);
}
 
开发者ID:springuni,项目名称:springuni-particles,代码行数:20,代码来源:AuthSecurityConfiguration.java

示例3: persistentTokenRepository

import org.springframework.security.web.authentication.rememberme.PersistentTokenRepository; //导入依赖的package包/类
/**
 * Persistent token repository persistent token repository.
 *
 * @return the persistent token repository
 */
@Bean
public PersistentTokenRepository persistentTokenRepository() {
    JdbcTokenRepositoryImpl jdbcTokenRepository = new JdbcTokenRepositoryImpl();
    jdbcTokenRepository.setDataSource(dataSource);
    return jdbcTokenRepository;
}
 
开发者ID:mhaddon,项目名称:Sound.je,代码行数:12,代码来源:WebSecurityConfig.java

示例4: rememberMeServices

import org.springframework.security.web.authentication.rememberme.PersistentTokenRepository; //导入依赖的package包/类
@Bean
public RememberMeServices rememberMeServices(
    UserDetailsService userDetailsService, PersistentTokenRepository persistentTokenRepository) {

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

  return new PersistentJwtTokenBasedRememberMeServices(
      secretKey, userDetailsService, persistentTokenRepository);
}
 
开发者ID:springuni,项目名称:springuni-particles,代码行数:10,代码来源:AuthSecurityConfiguration.java

示例5: persistentTokenRepository

import org.springframework.security.web.authentication.rememberme.PersistentTokenRepository; //导入依赖的package包/类
@Bean
public PersistentTokenRepository persistentTokenRepository() {
	JdbcTokenRepositoryImpl db = new JdbcTokenRepositoryImpl();
	db.setDataSource(dataSource);

	return db;
}
 
开发者ID:edylle,项目名称:pathological-reports,代码行数:8,代码来源:SecurityConfiguration.java

示例6: persistentTokenRepository

import org.springframework.security.web.authentication.rememberme.PersistentTokenRepository; //导入依赖的package包/类
@Bean
public PersistentTokenRepository persistentTokenRepository(JdbcTemplate jdbcTemplate) {
    JdbcTokenRepositoryImpl jdbcTokenRepositoryImpl = new JdbcTokenRepositoryImpl();
    jdbcTokenRepositoryImpl.setJdbcTemplate(jdbcTemplate);
    jdbcTokenRepositoryImpl.setCreateTableOnStartup(false);
    return jdbcTokenRepositoryImpl;
}
 
开发者ID:zjnu-acm,项目名称:judge,代码行数:8,代码来源:TokenRepositoryConfiguration.java

示例7: protect

import org.springframework.security.web.authentication.rememberme.PersistentTokenRepository; //导入依赖的package包/类
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();
    
}
 
开发者ID:gjong,项目名称:web-harvester,代码行数:10,代码来源:WebSecurityConfiguration.java

示例8: afterPropertiesSet

import org.springframework.security.web.authentication.rememberme.PersistentTokenRepository; //导入依赖的package包/类
@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){
	}
}
 
开发者ID:u2ware,项目名称:springfield,代码行数:15,代码来源:PersistentTokenRepositoryDetector.java

示例9: jdbcTokenRepository

import org.springframework.security.web.authentication.rememberme.PersistentTokenRepository; //导入依赖的package包/类
@Bean
public PersistentTokenRepository jdbcTokenRepository() {
	JdbcTokenRepositoryImpl repository = new JdbcTokenRepositoryImpl();
	repository.setCreateTableOnStartup(false);
	repository.setDataSource(dataSource);			
	return repository;
}
 
开发者ID:markoradinovic,项目名称:Vaadin4Spring-MVP-Sample-SpringSecurity,代码行数:8,代码来源:SecurityConfig.java

示例10: IpAwarePersistentTokenRepository

import org.springframework.security.web.authentication.rememberme.PersistentTokenRepository; //导入依赖的package包/类
/**
 * 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;
}
 
开发者ID:v5developer,项目名称:maven-framework-project,代码行数:13,代码来源:IpAwarePersistentTokenRepository.java

示例11: persistentTokenRepository

import org.springframework.security.web.authentication.rememberme.PersistentTokenRepository; //导入依赖的package包/类
@Bean
public PersistentTokenRepository persistentTokenRepository() {
    JdbcTokenRepositoryImpl tokenRepository = new JdbcTokenRepositoryImpl();
    tokenRepository.setDataSource(dataSource);
    return tokenRepository;
}
 
开发者ID:ziwenxie,项目名称:leafer,代码行数:7,代码来源:WebSecurityConfig.java

示例12: PersistentJwtTokenBasedRememberMeServices

import org.springframework.security.web.authentication.rememberme.PersistentTokenRepository; //导入依赖的package包/类
public PersistentJwtTokenBasedRememberMeServices(
    String key, UserDetailsService userDetailsService,
    PersistentTokenRepository tokenRepository) {

  super(key, userDetailsService, tokenRepository);
}
 
开发者ID:springuni,项目名称:springuni-particles,代码行数:7,代码来源:PersistentJwtTokenBasedRememberMeServices.java

示例13: persistentTokenRepository

import org.springframework.security.web.authentication.rememberme.PersistentTokenRepository; //导入依赖的package包/类
@Bean
public PersistentTokenRepository persistentTokenRepository(SessionService sessionService) {
  return new DelegatingPersistentTokenRepository(sessionService);
}
 
开发者ID:springuni,项目名称:springuni-particles,代码行数:5,代码来源:AuthSecurityConfiguration.java

示例14: persistentTokenRepository

import org.springframework.security.web.authentication.rememberme.PersistentTokenRepository; //导入依赖的package包/类
@Bean
public PersistentTokenRepository persistentTokenRepository() {
	JdbcTokenRepositoryImpl db = new JdbcTokenRepositoryImpl();
	db.setDataSource(dataSource);
	return db;
}
 
开发者ID:oojorgeoo89,项目名称:QuizZz,代码行数:7,代码来源:SecurityConfig.java

示例15: persistentTokenRepository

import org.springframework.security.web.authentication.rememberme.PersistentTokenRepository; //导入依赖的package包/类
@Bean
public PersistentTokenRepository persistentTokenRepository(){
    JdbcTokenRepositoryImpl tokenRepository = new JdbcTokenRepositoryImpl();
    tokenRepository.setDataSource(dataSource);
    return tokenRepository;
}
 
开发者ID:Exercon,项目名称:AntiSocial-Platform,代码行数:7,代码来源:SecurityConfiguration.java


注:本文中的org.springframework.security.web.authentication.rememberme.PersistentTokenRepository类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。