本文整理汇总了Java中org.springframework.security.web.authentication.RememberMeServices类的典型用法代码示例。如果您正苦于以下问题:Java RememberMeServices类的具体用法?Java RememberMeServices怎么用?Java RememberMeServices使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
RememberMeServices类属于org.springframework.security.web.authentication包,在下文中一共展示了RememberMeServices类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateRememberMeService
import org.springframework.security.web.authentication.RememberMeServices; //导入依赖的package包/类
/**
* 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);
}
}
}
}
示例2: setRememberMeServices
import org.springframework.security.web.authentication.RememberMeServices; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public void setRememberMeServices(RememberMeServices rememberMeServices) {
this.rememberMeServices = rememberMeServices;
}
示例3: SecurityConfiguration
import org.springframework.security.web.authentication.RememberMeServices; //导入依赖的package包/类
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;
}
示例4: WebSecurityConfig
import org.springframework.security.web.authentication.RememberMeServices; //导入依赖的package包/类
public WebSecurityConfig(UserService userService, PasswordEncoder passwordEncoder,
RememberMeServices rememberMeServices, SessionRegistry sessionRegistry) {
this.userService = userService;
this.passwordEncoder = passwordEncoder;
this.rememberMeServices = rememberMeServices;
this.sessionRegistry = sessionRegistry;
}
示例5: rememberMeServices
import org.springframework.security.web.authentication.RememberMeServices; //导入依赖的package包/类
@Bean
public RememberMeServices rememberMeServices(
UserDetailsService userDetailsService, PersistentTokenRepository persistentTokenRepository) {
String secretKey = getRememberMeTokenSecretKey().orElseThrow(IllegalStateException::new);
return new PersistentJwtTokenBasedRememberMeServices(
secretKey, userDetailsService, persistentTokenRepository);
}
示例6: SecurityConfiguration
import org.springframework.security.web.authentication.RememberMeServices; //导入依赖的package包/类
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;
}
示例7: configure
import org.springframework.security.web.authentication.RememberMeServices; //导入依赖的package包/类
@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);
}
示例8: rememberMeServices
import org.springframework.security.web.authentication.RememberMeServices; //导入依赖的package包/类
@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;
}
示例9: rememberMeServices
import org.springframework.security.web.authentication.RememberMeServices; //导入依赖的package包/类
@Bean
public RememberMeServices rememberMeServices() {
PersistentTokenBasedRememberMeServices services = new PersistentTokenBasedRememberMeServices(
environment.getProperty("RM_KEY", "grassrootremembers"),
userDetailsService, persistentTokenRepository());
services.setTokenValiditySeconds(1209600); // two weeks
return services;
}
示例10: rememberMeServices
import org.springframework.security.web.authentication.RememberMeServices; //导入依赖的package包/类
@Bean
public RememberMeServices rememberMeServices(String rememberBeKey) {
return new PersistentTokenBasedRememberMeServices(
rememberBeKey,
basicRememberMeUserDetailsService(),
new InMemoryTokenRepositoryImpl()
);
}
示例11: persistentTokenBasedRememberMeServices
import org.springframework.security.web.authentication.RememberMeServices; //导入依赖的package包/类
@Bean
public RememberMeServices persistentTokenBasedRememberMeServices() {
VaadinPersistentTokenBasedRememberMeServices services = new VaadinPersistentTokenBasedRememberMeServices(
"vaadin4spring",
userDetailsService,
jdbcTokenRepository());
services.setCookieName("REMEMBERME");
return services;
}
示例12: getRememberMeServices
import org.springframework.security.web.authentication.RememberMeServices; //导入依赖的package包/类
@Bean
public RememberMeServices getRememberMeServices() {
PersistentTokenBasedRememberMeServices services = new PersistentTokenBasedRememberMeServices(
rememberMeToken, new BasicRememberMeUserDetailsService(), new InMemoryTokenRepositoryImpl());
services.setParameter(rememberMeParameter);
return services;
}
示例13: rememberMeServices
import org.springframework.security.web.authentication.RememberMeServices; //导入依赖的package包/类
@Bean
public RememberMeServices rememberMeServices() {
return new SpringSessionRememberMeServices();
}
示例14: ProceedingRememberMeAuthenticationFilter
import org.springframework.security.web.authentication.RememberMeServices; //导入依赖的package包/类
public ProceedingRememberMeAuthenticationFilter(
AuthenticationManager authenticationManager, RememberMeServices rememberMeServices) {
super(authenticationManager, rememberMeServices);
}
示例15: RememberMeLoginFilter
import org.springframework.security.web.authentication.RememberMeServices; //导入依赖的package包/类
public RememberMeLoginFilter(AuthenticationManager authenticationManager,
RememberMeServices rememberMeServices) {
super(authenticationManager, rememberMeServices);
}