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

项目:artifactory    文件:LoginService.java   
/**
 * update spring remember me service with login status
 * @param artifactoryContext - artifactory web context
 * @param isUpdateSucceeded - if true authentication has been updated successfully
 * @param artifactoryRestRequest - encapsulate data related to request
 * @param artifactoryRestResponse - encapsulate data needed for response
 */
private void updateRememberMeService(ArtifactoryContext artifactoryContext,
        boolean isUpdateSucceeded,ArtifactoryRestRequest artifactoryRestRequest,
        RestResponse artifactoryRestResponse) {
    HttpServletRequest servletRequest = artifactoryRestRequest.getServletRequest();
    HttpServletResponse servletResponse = artifactoryRestResponse.getServletResponse();
    if (isUpdateSucceeded) {
        RememberMeServices rememberMeServices = (RememberMeServices) artifactoryContext.getBean(
                "rememberMeServices");
        if (!ConstantValues.securityDisableRememberMe.getBoolean()) {
            try {
                rememberMeServices.loginSuccess(servletRequest, servletResponse,
                        AuthenticationHelper.getAuthentication());
            } catch (UsernameNotFoundException e) {
                log.warn("Remember Me service is not supported for transient external users.");
            }
        } else {
            if (!ConstantValues.securityDisableRememberMe.getBoolean()) {
                rememberMeServices.loginFail(servletRequest, servletResponse);
            }
        }
    }
}
项目:MTC_Labrat    文件:SecurityConfiguration.java   
public SecurityConfiguration(AuthenticationManagerBuilder authenticationManagerBuilder, UserDetailsService userDetailsService,
    JHipsterProperties jHipsterProperties, RememberMeServices rememberMeServices,
    CorsFilter corsFilter) {

    this.authenticationManagerBuilder = authenticationManagerBuilder;
    this.userDetailsService = userDetailsService;
    this.jHipsterProperties = jHipsterProperties;
    this.rememberMeServices = rememberMeServices;
    this.corsFilter = corsFilter;
}
项目:theskeleton    文件:WebSecurityConfig.java   
public WebSecurityConfig(UserService userService, PasswordEncoder passwordEncoder,
                         RememberMeServices rememberMeServices, SessionRegistry sessionRegistry) {
    this.userService = userService;
    this.passwordEncoder = passwordEncoder;
    this.rememberMeServices = rememberMeServices;
    this.sessionRegistry = sessionRegistry;
}
项目:patient-portal    文件:SecurityConfiguration.java   
public SecurityConfiguration(AuthenticationManagerBuilder authenticationManagerBuilder, UserDetailsService userDetailsService,
    JHipsterProperties jHipsterProperties, RememberMeServices rememberMeServices,
    CorsFilter corsFilter) {

    this.authenticationManagerBuilder = authenticationManagerBuilder;
    this.userDetailsService = userDetailsService;
    this.jHipsterProperties = jHipsterProperties;
    this.rememberMeServices = rememberMeServices;
    this.corsFilter = corsFilter;
}
项目:springuni-particles    文件:AuthSecurityConfiguration.java   
@Bean
public RememberMeServices rememberMeServices(
    UserDetailsService userDetailsService, PersistentTokenRepository persistentTokenRepository) {

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

  return new PersistentJwtTokenBasedRememberMeServices(
      secretKey, userDetailsService, persistentTokenRepository);
}
项目:qualitoast    文件:SecurityConfiguration.java   
public SecurityConfiguration(AuthenticationManagerBuilder authenticationManagerBuilder, UserDetailsService userDetailsService,
    JHipsterProperties jHipsterProperties, RememberMeServices rememberMeServices,CorsFilter corsFilter, SecurityProblemSupport problemSupport) {
    this.authenticationManagerBuilder = authenticationManagerBuilder;
    this.userDetailsService = userDetailsService;
    this.jHipsterProperties = jHipsterProperties;
    this.rememberMeServices = rememberMeServices;
    this.corsFilter = corsFilter;
    this.problemSupport = problemSupport;
}
项目:oma-riista-web    文件:OneTimePasswordFilterConfigurer.java   
@Override
public void configure(HttpSecurity http) {
    authFilter.setAuthenticationDetailsSource(new WebAuthenticationDetailsSource());
    authFilter.setApplicationEventPublisher(
            Objects.requireNonNull(http.getSharedObject(ApplicationContext.class)));
    authFilter.setAuthenticationManager(
            Objects.requireNonNull(http.getSharedObject(AuthenticationManager.class)));
    authFilter.setSessionAuthenticationStrategy(
            Objects.requireNonNull(http.getSharedObject(SessionAuthenticationStrategy.class)));
    authFilter.setRememberMeServices(
            Objects.requireNonNull(http.getSharedObject(RememberMeServices.class)));

    http.addFilterBefore(authFilter, UsernamePasswordAuthenticationFilter.class);
}
项目:java-hostel    文件:SecurityConfiguration.java   
public SecurityConfiguration(AuthenticationManagerBuilder authenticationManagerBuilder, UserDetailsService userDetailsService,
    JHipsterProperties jHipsterProperties, RememberMeServices rememberMeServices,
    CorsFilter corsFilter) {

    this.authenticationManagerBuilder = authenticationManagerBuilder;
    this.userDetailsService = userDetailsService;
    this.jHipsterProperties = jHipsterProperties;
    this.rememberMeServices = rememberMeServices;
    this.corsFilter = corsFilter;
}
项目:trader    文件:TraderApplication.java   
@Bean
public RememberMeServices rememberMeServices() {
    // TODO Is there some way of exposing the RememberMeServices instance that the remember me configurer creates by default?
    TokenBasedRememberMeServices services = new TokenBasedRememberMeServices("myAppKey", userDetailsService());
    services.setAlwaysRemember(true);
    return services;
}
项目:grassroot-platform    文件:SecurityConfig.java   
@Bean
public RememberMeServices rememberMeServices() {
    PersistentTokenBasedRememberMeServices services = new PersistentTokenBasedRememberMeServices(
            environment.getProperty("RM_KEY", "grassrootremembers"),
            userDetailsService, persistentTokenRepository());
    services.setTokenValiditySeconds(1209600); // two weeks
    return services;
}
项目:ontrack    文件:WebSecurityConfig.java   
@Bean
public RememberMeServices rememberMeServices(String rememberBeKey) {
    return new PersistentTokenBasedRememberMeServices(
            rememberBeKey,
            basicRememberMeUserDetailsService(),
            new InMemoryTokenRepositoryImpl()
    );
}
项目:Vaadin4Spring-MVP-Sample-SpringSecurity    文件:SecurityConfig.java   
@Bean
public RememberMeServices persistentTokenBasedRememberMeServices() {
    VaadinPersistentTokenBasedRememberMeServices services = new VaadinPersistentTokenBasedRememberMeServices(
            "vaadin4spring", 
            userDetailsService, 
            jdbcTokenRepository());
    services.setCookieName("REMEMBERME");
    return services;
}
项目:enhanced-pet-clinic    文件:MultiHttpSecurityConfig.java   
@Bean
public RememberMeServices getRememberMeServices() {
    PersistentTokenBasedRememberMeServices services = new PersistentTokenBasedRememberMeServices(
            rememberMeToken, new BasicRememberMeUserDetailsService(), new InMemoryTokenRepositoryImpl());
    services.setParameter(rememberMeParameter);
    return services;
}
项目:enhanced-pet-clinic    文件:MultiHttpSecurityConfig.java   
@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;
}
项目:theskeleton    文件:WebSessionConfig.java   
@Bean
public RememberMeServices rememberMeServices() {
    return new SpringSessionRememberMeServices();
}
项目:springuni-particles    文件:ProceedingRememberMeAuthenticationFilter.java   
public ProceedingRememberMeAuthenticationFilter(
    AuthenticationManager authenticationManager, RememberMeServices rememberMeServices) {

  super(authenticationManager, rememberMeServices);
}
项目:bdf2    文件:RememberMeLoginFilter.java   
public RememberMeLoginFilter(AuthenticationManager authenticationManager,
        RememberMeServices rememberMeServices) {
    super(authenticationManager, rememberMeServices);
}
项目:osoon    文件:OSoonRememberMeAuthenticationFilter.java   
public OSoonRememberMeAuthenticationFilter(RememberMeServices rememberMeServices) {
    this.rememberMeServices = rememberMeServices;
}
项目:bbplay    文件:SecurityConfiguration.java   
/**
 * The {@link RememberMeServices} must be available as a Spring bean for
 * Vaadin4Spring.
 */
@Bean
public RememberMeServices rememberMeServices() {
    return new TokenBasedRememberMeServices(REMEMBERME_KEY, userDetailsService());
}
项目:todolist    文件:WebSecurityConfiguration.java   
@Bean
public RememberMeServices rememberMeServices() throws Exception {
    TokenBasedRememberMeServices result = new TokenBasedRememberMeServices("hell0w0r1d", service);
    result.setTokenValiditySeconds(2419200);
    return result;
}
项目:flowable-engine    文件:SecurityConfiguration.java   
@Bean
public RememberMeServices rememberMeServices() {
    return new CustomPersistentRememberMeServices(env, userDetailsService());
}
项目:communote-server    文件:CommunoteRememberMeProcessingFilter.java   
/**
 * {@inheritDoc}
 */
@Override
public void setRememberMeServices(RememberMeServices rememberMeServices) {
    this.rememberMeServices = rememberMeServices;
}
项目:putput    文件:WebSecurityConfig.java   
@Bean
@Profile({"production", "unit"})
public RememberMeServices rememberMeServices() {
  return new PutPutRememberMeServices("token", userDetailsService);
}
项目:cloudstreetmarket.com    文件:CustomOAuth2RequestFilter.java   
public void setRememberMeServices(RememberMeServices rememberMeServices) {
    Assert.notNull(rememberMeServices, "rememberMeServices cannot be null");
    this.rememberMeServices = rememberMeServices;
}
项目:rest    文件:MyBasicAuthenticationFilter.java   
public void setRememberMeServices(RememberMeServices rememberMeServices) {
    Assert.notNull(rememberMeServices, "rememberMeServices cannot be null");
    this.rememberMeServices = rememberMeServices;
}
项目:aggregate    文件:BasicAuthenticationFilter.java   
public void  setRememberMeServices(RememberMeServices rememberMeServices) {
  impl.setRememberMeServices(rememberMeServices);
}
项目:summerb    文件:RestLoginFilter.java   
public RememberMeServices getRememberMeServices() {
    return rememberMeServices;
}
项目:summerb    文件:RestLoginFilter.java   
public void setRememberMeServices(RememberMeServices rememberMeServices) {
    this.rememberMeServices = rememberMeServices;
}
项目:simple-facebook-integration-spring-sec    文件:HomeController.java   
@Inject
public HomeController(UserRepository userRepository, RememberMeServices rememberMeServices) {
    this.userRepository = userRepository;
    this.rememberMeServices = rememberMeServices;
}
项目:eHMP    文件:VistaBasicAuthenticationFilter.java   
public void setRememberMeServices(RememberMeServices rememberMeServices) {
    Assert.notNull(rememberMeServices, "rememberMeServices cannot be null");
    this.rememberMeServices = rememberMeServices;
}
项目:appverse-server    文件:CustomUserNamePasswordAuthenticationFilter.java   
public void setRememberMeServices(RememberMeServices rememberMeServices) {
    Assert.notNull(rememberMeServices, "rememberMeServices cannot be null");
    this.rememberMeServices = rememberMeServices;
}
项目:vaadin4spring    文件:AbstractVaadinSecurity.java   
@Override
public RememberMeServices getRememberMeServices() {
    return rememberMeServices;
}
项目:vaadin4spring    文件:Application.java   
/**
 * The {@link RememberMeServices} must be available as a Spring bean for Vaadin4Spring.
 */
@Bean
public RememberMeServices rememberMeServices() {
    return new TokenBasedRememberMeServices("myAppKey", userDetailsService());
}
项目:adjule    文件:SecurityConfig.java   
@Bean
public RememberMeServices rememberMeServices() {
    return new TokenBasedRememberMeServices(env.getProperty("appKey"), userDetailsService);
}
项目:Vaadin4Spring-MVP-Sample-SpringSecuritySocial    文件:VaadinSpringSocialConfigurer.java   
@Override
    public void configure(HttpSecurity http) throws Exception {     
        ApplicationContext applicationContext = http.getSharedObject(ApplicationContext.class);
        UsersConnectionRepository usersConnectionRepository = getDependency(applicationContext, UsersConnectionRepository.class);
        SocialAuthenticationServiceLocator authServiceLocator = getDependency(applicationContext, SocialAuthenticationServiceLocator.class);
        SocialUserDetailsService socialUsersDetailsService = getDependency(applicationContext, SocialUserDetailsService.class);

        SocialAuthenticationFilter filter = new SocialAuthenticationFilter(
                http.getSharedObject(AuthenticationManager.class), 
                userIdSource != null ? userIdSource : new AuthenticationNameUserIdSource(), 
                usersConnectionRepository, 
                authServiceLocator);

        RememberMeServices rememberMe = http.getSharedObject(RememberMeServices.class);
        if (rememberMe != null) {
            filter.setRememberMeServices(rememberMe);
        }

        if (postLoginUrl != null) {
            filter.setPostLoginUrl(postLoginUrl);
            filter.setAlwaysUsePostLoginUrl(alwaysUsePostLoginUrl);
        }

        if (postFailureUrl != null) {
            /*
             * This is throwing 
             * java.lang.IllegalStateException: 
             * can't set postFailureUrl on unknown failureHandler, type is org.springframework.social.security.SocialAuthenticationFailureHandler 
             */
//          filter.setPostFailureUrl(postFailureUrl);
            filter.setDefaultFailureUrl(postFailureUrl);
        }

        if (signupUrl != null) {
            filter.setSignupUrl(signupUrl);                 
        }

        http.authenticationProvider(
                new SocialAuthenticationProvider(usersConnectionRepository, socialUsersDetailsService))
            .addFilterBefore(postProcess(filter), AbstractPreAuthenticatedProcessingFilter.class);
    }
项目:cevent-app    文件:SecurityConfiguration.java   
@Bean
public RememberMeServices rememberMeServices() {
    return new CustomPersistentRememberMeServices(env, userDetailsService());
}
项目:AIDR    文件:SpringSocialAuthenticationFilter.java   
@Override
@Autowired(required = false)
public void setRememberMeServices(RememberMeServices rememberMeServices) {
    super.setRememberMeServices(rememberMeServices);
}
项目:AIDR    文件:SpringSocialAuthenticationFilter.java   
@Override
@Autowired(required = false)
public void setRememberMeServices(RememberMeServices rememberMeServices) {
    super.setRememberMeServices(rememberMeServices);
}
项目:termitaria    文件:TokenBasedAuthenticationFilter.java   
public void setRememberMeServices(RememberMeServices rememberMeServices) {
    Assert.notNull(rememberMeServices, "rememberMeServices cannot be null");
    this.rememberMeServices = rememberMeServices;
}
项目:termitaria    文件:TokenBasedAuthenticationFilter.java   
public void setRememberMeServices(RememberMeServices rememberMeServices) {
    Assert.notNull(rememberMeServices, "rememberMeServices cannot be null");
    this.rememberMeServices = rememberMeServices;
}