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


Java LogoutSuccessHandler類代碼示例

本文整理匯總了Java中org.springframework.security.web.authentication.logout.LogoutSuccessHandler的典型用法代碼示例。如果您正苦於以下問題:Java LogoutSuccessHandler類的具體用法?Java LogoutSuccessHandler怎麽用?Java LogoutSuccessHandler使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


LogoutSuccessHandler類屬於org.springframework.security.web.authentication.logout包,在下文中一共展示了LogoutSuccessHandler類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: configure

import org.springframework.security.web.authentication.logout.LogoutSuccessHandler; //導入依賴的package包/類
@SuppressWarnings("ProhibitedExceptionDeclared")
@Override
protected void configure(final HttpSecurity http) throws Exception {
    final AuthenticationEntryPoint ssoEntryPoint = new SsoAuthenticationEntryPoint(SsoController.SSO_PAGE);

    final SsoAuthenticationFilter<?> ssoAuthenticationFilter = new SsoAuthenticationFilter<>(SsoController.SSO_AUTHENTICATION_URI, EntityType.CombinedSso.INSTANCE);
    ssoAuthenticationFilter.setAuthenticationManager(authenticationManager());

    final LogoutSuccessHandler logoutSuccessHandler = new HodTokenLogoutSuccessHandler(SsoController.SSO_LOGOUT_PAGE, tokenRepository);

    http.regexMatcher("/public(/.*)?|/sso|/authenticate-sso|/api/authentication/.*|/logout")
        .csrf()
            .disable()
        .exceptionHandling()
            .authenticationEntryPoint(ssoEntryPoint)
            .accessDeniedPage(DispatcherServletConfiguration.AUTHENTICATION_ERROR_PATH)
            .and()
        .authorizeRequests()
            .antMatchers(FindController.APP_PATH + "/**").hasRole(FindRole.USER.name())
            .and()
        .logout()
            .logoutSuccessHandler(logoutSuccessHandler)
            .and()
        .addFilterAfter(ssoAuthenticationFilter, AbstractPreAuthenticatedProcessingFilter.class);
}
 
開發者ID:hpe-idol,項目名稱:find,代碼行數:26,代碼來源:HodSecurity.java

示例2: logoutSuccessHandler

import org.springframework.security.web.authentication.logout.LogoutSuccessHandler; //導入依賴的package包/類
protected LogoutSuccessHandler logoutSuccessHandler() {
	return new LogoutSuccessHandler() {
		
		@Override
		public void onLogoutSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication)
				throws IOException, ServletException {
			response.getWriter().append("OK");
			response.setStatus(200);
		}
	};
}
 
開發者ID:vishal1997,項目名稱:DiscussionPortal,代碼行數:12,代碼來源:AuthenticationHandler.java

示例3: logoutSuccessHandler

import org.springframework.security.web.authentication.logout.LogoutSuccessHandler; //導入依賴的package包/類
/**
 * Logout success handler, removing cookie auth
 *
 * @return
 */
@Bean
public LogoutSuccessHandler logoutSuccessHandler() {
	return (HttpServletRequest request, HttpServletResponse response, Authentication authentication) -> {
		if (authentication != null && authentication.getPrincipal() != null) {
			LOG.info("LOGOUT >>> " + authentication.getPrincipal());
		} else {
			LOG.info("LOGOUT >>> called without authentication");
		}
		apiAuth.remove(request, response);
		response.setStatus(HttpServletResponse.SC_OK);
		response.getWriter().flush();
	};
}
 
開發者ID:alextremp,項目名稱:stateless-rest-jwtcookie-demo,代碼行數:19,代碼來源:SecurityInternalConfig.java

示例4: dashboardLogoutSuccessHandler

import org.springframework.security.web.authentication.logout.LogoutSuccessHandler; //導入依賴的package包/類
@Bean(name = "dashboardLogoutSuccessHandler")
public LogoutSuccessHandler dashboardLogoutSuccessHandler() {
    final SimpleUrlLogoutSuccessHandler logoutSuccessHandler = new SimpleUrlLogoutSuccessHandler();

    logoutSuccessHandler.setRedirectStrategy(new DashboardLogoutRedirectStrategy(logoutUrl));

    return logoutSuccessHandler;
}
 
開發者ID:bsblabs,項目名稱:cf-sample-service,代碼行數:9,代碼來源:DashboardSecurityConfiguration.java

示例5: ajaxLogoutSuccessHandler

import org.springframework.security.web.authentication.logout.LogoutSuccessHandler; //導入依賴的package包/類
@Bean
public LogoutSuccessHandler ajaxLogoutSuccessHandler() {
  return (request, response, authentication) -> {
    response.setStatus(HttpServletResponse.SC_OK);
    response.flushBuffer();
  };
}
 
開發者ID:mnivoliez,項目名稱:CardWizard,代碼行數:8,代碼來源:SecurityConfig.java

示例6: casLogoutSuccessHandler

import org.springframework.security.web.authentication.logout.LogoutSuccessHandler; //導入依賴的package包/類
@Bean
public LogoutSuccessHandler casLogoutSuccessHandler() {
	CasLogoutSuccessHandler handler = new CasLogoutSuccessHandler();
	handler.setCasUrl(casUrl);
	handler.setDefaultTarget(rootUrl);

	return handler;
}
 
開發者ID:thm-projects,項目名稱:arsnova-backend,代碼行數:9,代碼來源:SecurityConfig.java

示例7: logoutSuccessHandler

import org.springframework.security.web.authentication.logout.LogoutSuccessHandler; //導入依賴的package包/類
@Bean
public LogoutSuccessHandler logoutSuccessHandler() {
    return new LogoutSuccessHandlerImpl();
}
 
開發者ID:yuexine,項目名稱:loafer,代碼行數:5,代碼來源:SecurityConfiguration.java

示例8: logoutSuccessHandler

import org.springframework.security.web.authentication.logout.LogoutSuccessHandler; //導入依賴的package包/類
@Bean
public LogoutSuccessHandler logoutSuccessHandler() {
	return (request, response, authentication) -> response.setStatus(HttpServletResponse.SC_OK);
}
 
開發者ID:adessoAG,項目名稱:JenkinsHue,代碼行數:5,代碼來源:SecurityConfiguration.java

示例9: logoutSuccessHandlerImpl

import org.springframework.security.web.authentication.logout.LogoutSuccessHandler; //導入依賴的package包/類
@Bean
public LogoutSuccessHandler logoutSuccessHandlerImpl() {
    return new LogoutSuccessHandlerRestImpl();
}
 
開發者ID:melthaw,項目名稱:spring-backend-boilerplate,代碼行數:5,代碼來源:OpenApiSecurityConfigurer.java

示例10: logoutSuccessHandler

import org.springframework.security.web.authentication.logout.LogoutSuccessHandler; //導入依賴的package包/類
@Bean
public LogoutSuccessHandler logoutSuccessHandler() {
  return new CustomLogoutSuccessHandler();
}
 
開發者ID:fier-liu,項目名稱:FCat,代碼行數:5,代碼來源:WebSecurityConfig.java

示例11: PentahoSamlLogoutFilter

import org.springframework.security.web.authentication.logout.LogoutSuccessHandler; //導入依賴的package包/類
public PentahoSamlLogoutFilter( LogoutSuccessHandler logoutSuccessHandler, LogoutHandler[] localHandler, LogoutHandler[] globalHandlers ) {
  super( logoutSuccessHandler, localHandler, globalHandlers );
}
 
開發者ID:pentaho,項目名稱:pentaho-engineering-samples,代碼行數:4,代碼來源:PentahoSamlLogoutFilter.java

示例12: PentahoSamlLogoutProcessingFilter

import org.springframework.security.web.authentication.logout.LogoutSuccessHandler; //導入依賴的package包/類
public PentahoSamlLogoutProcessingFilter( LogoutSuccessHandler logoutSuccessHandler, LogoutHandler... handlers ) {
  super( logoutSuccessHandler, handlers );
}
 
開發者ID:pentaho,項目名稱:pentaho-engineering-samples,代碼行數:4,代碼來源:PentahoSamlLogoutProcessingFilter.java

示例13: setDelegate

import org.springframework.security.web.authentication.logout.LogoutSuccessHandler; //導入依賴的package包/類
public void setDelegate(LogoutSuccessHandler delegate) {
    this.delegate = delegate;
}
 
開發者ID:hflabs,項目名稱:perecoder,代碼行數:4,代碼來源:AuthenticationCleanedEventHandler.java

示例14: logoutSuccessHandler

import org.springframework.security.web.authentication.logout.LogoutSuccessHandler; //導入依賴的package包/類
@Bean
public LogoutSuccessHandler logoutSuccessHandler() {
    return new AjaxLogoutSuccessHandler();
}
 
開發者ID:learning-layers,項目名稱:LivingDocumentsServer,代碼行數:5,代碼來源:OIDCSecurityConfig.java

示例15: configureGlobal

import org.springframework.security.web.authentication.logout.LogoutSuccessHandler; //導入依賴的package包/類
@Autowired
public void configureGlobal(AuthenticationManagerBuilder auth, AuthManager authManager, LogoutSuccessHandler logoutSuccessHandler) throws Exception {
    this.logoutSuccessHandler = logoutSuccessHandler;
    auth.authenticationProvider(new LaunchKeyAuthenticationProvider(authManager));
}
 
開發者ID:iovation,項目名稱:launchkey-java,代碼行數:6,代碼來源:SecurityConfig.java


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