/** * 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); } } } }
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; }
public WebSecurityConfig(UserService userService, PasswordEncoder passwordEncoder, RememberMeServices rememberMeServices, SessionRegistry sessionRegistry) { this.userService = userService; this.passwordEncoder = passwordEncoder; this.rememberMeServices = rememberMeServices; this.sessionRegistry = sessionRegistry; }
@Bean public RememberMeServices rememberMeServices( UserDetailsService userDetailsService, PersistentTokenRepository persistentTokenRepository) { String secretKey = getRememberMeTokenSecretKey().orElseThrow(IllegalStateException::new); return new PersistentJwtTokenBasedRememberMeServices( secretKey, userDetailsService, persistentTokenRepository); }
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; }
@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); }
@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; }
@Bean public RememberMeServices rememberMeServices() { PersistentTokenBasedRememberMeServices services = new PersistentTokenBasedRememberMeServices( environment.getProperty("RM_KEY", "grassrootremembers"), userDetailsService, persistentTokenRepository()); services.setTokenValiditySeconds(1209600); // two weeks return services; }
@Bean public RememberMeServices rememberMeServices(String rememberBeKey) { return new PersistentTokenBasedRememberMeServices( rememberBeKey, basicRememberMeUserDetailsService(), new InMemoryTokenRepositoryImpl() ); }
@Bean public RememberMeServices persistentTokenBasedRememberMeServices() { VaadinPersistentTokenBasedRememberMeServices services = new VaadinPersistentTokenBasedRememberMeServices( "vaadin4spring", userDetailsService, jdbcTokenRepository()); services.setCookieName("REMEMBERME"); return services; }
@Bean public RememberMeServices getRememberMeServices() { PersistentTokenBasedRememberMeServices services = new PersistentTokenBasedRememberMeServices( rememberMeToken, new BasicRememberMeUserDetailsService(), new InMemoryTokenRepositoryImpl()); services.setParameter(rememberMeParameter); return services; }
@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; }
@Bean public RememberMeServices rememberMeServices() { return new SpringSessionRememberMeServices(); }
public ProceedingRememberMeAuthenticationFilter( AuthenticationManager authenticationManager, RememberMeServices rememberMeServices) { super(authenticationManager, rememberMeServices); }
public RememberMeLoginFilter(AuthenticationManager authenticationManager, RememberMeServices rememberMeServices) { super(authenticationManager, rememberMeServices); }
public OSoonRememberMeAuthenticationFilter(RememberMeServices rememberMeServices) { this.rememberMeServices = rememberMeServices; }
/** * The {@link RememberMeServices} must be available as a Spring bean for * Vaadin4Spring. */ @Bean public RememberMeServices rememberMeServices() { return new TokenBasedRememberMeServices(REMEMBERME_KEY, userDetailsService()); }
@Bean public RememberMeServices rememberMeServices() throws Exception { TokenBasedRememberMeServices result = new TokenBasedRememberMeServices("hell0w0r1d", service); result.setTokenValiditySeconds(2419200); return result; }
@Bean public RememberMeServices rememberMeServices() { return new CustomPersistentRememberMeServices(env, userDetailsService()); }
/** * {@inheritDoc} */ @Override public void setRememberMeServices(RememberMeServices rememberMeServices) { this.rememberMeServices = rememberMeServices; }
@Bean @Profile({"production", "unit"}) public RememberMeServices rememberMeServices() { return new PutPutRememberMeServices("token", userDetailsService); }
public void setRememberMeServices(RememberMeServices rememberMeServices) { Assert.notNull(rememberMeServices, "rememberMeServices cannot be null"); this.rememberMeServices = rememberMeServices; }
public void setRememberMeServices(RememberMeServices rememberMeServices) { impl.setRememberMeServices(rememberMeServices); }
public RememberMeServices getRememberMeServices() { return rememberMeServices; }
public void setRememberMeServices(RememberMeServices rememberMeServices) { this.rememberMeServices = rememberMeServices; }
@Inject public HomeController(UserRepository userRepository, RememberMeServices rememberMeServices) { this.userRepository = userRepository; this.rememberMeServices = rememberMeServices; }
@Override public RememberMeServices getRememberMeServices() { return rememberMeServices; }
/** * The {@link RememberMeServices} must be available as a Spring bean for Vaadin4Spring. */ @Bean public RememberMeServices rememberMeServices() { return new TokenBasedRememberMeServices("myAppKey", userDetailsService()); }
@Bean public RememberMeServices rememberMeServices() { return new TokenBasedRememberMeServices(env.getProperty("appKey"), userDetailsService); }
@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); }
@Override @Autowired(required = false) public void setRememberMeServices(RememberMeServices rememberMeServices) { super.setRememberMeServices(rememberMeServices); }