當前位置: 首頁>>代碼示例>>Java>>正文


Java RememberMeServices類代碼示例

本文整理匯總了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);
            }
        }
    }
}
 
開發者ID:alancnet,項目名稱:artifactory,代碼行數:30,代碼來源:LoginService.java

示例2: setRememberMeServices

import org.springframework.security.web.authentication.RememberMeServices; //導入依賴的package包/類
/**
 * {@inheritDoc}
 */
@Override
public void setRememberMeServices(RememberMeServices rememberMeServices) {
    this.rememberMeServices = rememberMeServices;
}
 
開發者ID:Communote,項目名稱:communote-server,代碼行數:8,代碼來源:CommunoteRememberMeProcessingFilter.java

示例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;
}
 
開發者ID:Microsoft,項目名稱:MTC_Labrat,代碼行數:11,代碼來源:SecurityConfiguration.java

示例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;
}
 
開發者ID:codenergic,項目名稱:theskeleton,代碼行數:8,代碼來源:WebSecurityConfig.java

示例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);
}
 
開發者ID:springuni,項目名稱:springuni-particles,代碼行數:10,代碼來源:AuthSecurityConfiguration.java

示例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;
}
 
開發者ID:pascalgrimaud,項目名稱:qualitoast,代碼行數:10,代碼來源:SecurityConfiguration.java

示例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);
}
 
開發者ID:suomenriistakeskus,項目名稱:oma-riista-web,代碼行數:15,代碼來源:OneTimePasswordFilterConfigurer.java

示例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;
}
 
開發者ID:xyfreemind,項目名稱:trader,代碼行數:8,代碼來源:TraderApplication.java

示例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;
}
 
開發者ID:grassrootza,項目名稱:grassroot-platform,代碼行數:9,代碼來源:SecurityConfig.java

示例10: rememberMeServices

import org.springframework.security.web.authentication.RememberMeServices; //導入依賴的package包/類
@Bean
public RememberMeServices rememberMeServices(String rememberBeKey) {
    return new PersistentTokenBasedRememberMeServices(
            rememberBeKey,
            basicRememberMeUserDetailsService(),
            new InMemoryTokenRepositoryImpl()
    );
}
 
開發者ID:nemerosa,項目名稱:ontrack,代碼行數:9,代碼來源:WebSecurityConfig.java

示例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;
}
 
開發者ID:markoradinovic,項目名稱:Vaadin4Spring-MVP-Sample-SpringSecurity,代碼行數:10,代碼來源:SecurityConfig.java

示例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;
}
 
開發者ID:arnaldop,項目名稱:enhanced-pet-clinic,代碼行數:8,代碼來源:MultiHttpSecurityConfig.java

示例13: rememberMeServices

import org.springframework.security.web.authentication.RememberMeServices; //導入依賴的package包/類
@Bean
public RememberMeServices rememberMeServices() {
	return new SpringSessionRememberMeServices();
}
 
開發者ID:codenergic,項目名稱:theskeleton,代碼行數:5,代碼來源:WebSessionConfig.java

示例14: ProceedingRememberMeAuthenticationFilter

import org.springframework.security.web.authentication.RememberMeServices; //導入依賴的package包/類
public ProceedingRememberMeAuthenticationFilter(
    AuthenticationManager authenticationManager, RememberMeServices rememberMeServices) {

  super(authenticationManager, rememberMeServices);
}
 
開發者ID:springuni,項目名稱:springuni-particles,代碼行數:6,代碼來源:ProceedingRememberMeAuthenticationFilter.java

示例15: RememberMeLoginFilter

import org.springframework.security.web.authentication.RememberMeServices; //導入依賴的package包/類
public RememberMeLoginFilter(AuthenticationManager authenticationManager,
		RememberMeServices rememberMeServices) {
	super(authenticationManager, rememberMeServices);
}
 
開發者ID:bsteker,項目名稱:bdf2,代碼行數:5,代碼來源:RememberMeLoginFilter.java


注:本文中的org.springframework.security.web.authentication.RememberMeServices類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。