本文整理匯總了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);
}