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


Java AccessDeniedHandler類代碼示例

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


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

示例1: configure

import org.springframework.security.web.access.AccessDeniedHandler; //導入依賴的package包/類
@Override
protected void configure(HttpSecurity http) throws Exception {
    http.exceptionHandling().accessDeniedHandler(new AccessDeniedHandler() {
        @Override
        public void handle(HttpServletRequest request, HttpServletResponse response, AccessDeniedException accessDeniedException) throws IOException, ServletException {
            accessDeniedException.printStackTrace();
        }
    })
            .and()
            .authorizeRequests()
            .antMatchers("/registration").permitAll()
            .anyRequest().authenticated()
            .and()
            .httpBasic()
            .and()
            .csrf().disable()
    ;
}
 
開發者ID:egch,項目名稱:sushi-bar-BE,代碼行數:19,代碼來源:WebSecurityConfig.java

示例2: FormLoginSecurityConfig

import org.springframework.security.web.access.AccessDeniedHandler; //導入依賴的package包/類
@Autowired
public FormLoginSecurityConfig(AccessDeniedHandler accessDeniedHandler,
                               UserDetailsService userDetailsService,
                               OAuth2ClientContext oauth2ClientContext) {
    this.accessDeniedHandler = accessDeniedHandler;
    this.userDetailsService = userDetailsService;
    this.oauth2ClientContext = oauth2ClientContext;
}
 
開發者ID:helloworldtang,項目名稱:sns-todo,代碼行數:9,代碼來源:FormLoginSecurityConfig.java

示例3: accessDeniedHandler

import org.springframework.security.web.access.AccessDeniedHandler; //導入依賴的package包/類
protected AccessDeniedHandler accessDeniedHandler() {
	return new AccessDeniedHandler() {
		@Override
		public void handle(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, AccessDeniedException e) throws IOException, ServletException {
			httpServletResponse.getWriter().append("Access denied");
			httpServletResponse.setStatus(403);
		}
	};
}
 
開發者ID:vishal1997,項目名稱:DiscussionPortal,代碼行數:10,代碼來源:AuthenticationHandler.java

示例4: ProfChoperSecurityConfig

import org.springframework.security.web.access.AccessDeniedHandler; //導入依賴的package包/類
@Autowired
public ProfChoperSecurityConfig(@Qualifier("profChoperDataSource") DataSource dataSource,
                                AccessDeniedHandler accessDeniedHandler,
                                AuthenticationSuccessHandler successHandler) {

    this.dataSource = dataSource;
    this.accessDeniedHandler = accessDeniedHandler;
    this.successHandler = successHandler;
}
 
開發者ID:ericywl,項目名稱:InfoSys-1D,代碼行數:10,代碼來源:ProfChoperSecurityConfig.java

示例5: getJwtAccessDeniedHandler

import org.springframework.security.web.access.AccessDeniedHandler; //導入依賴的package包/類
@Bean
public AccessDeniedHandler getJwtAccessDeniedHandler() {
	JwtAccessDeniedHandler handler = new JwtAccessDeniedHandler();
	return handler;
}
 
開發者ID:PacktPublishing,項目名稱:Practical-Microservices,代碼行數:6,代碼來源:SpringSecurityConfiguration.java

示例6: accessDeniedHandler

import org.springframework.security.web.access.AccessDeniedHandler; //導入依賴的package包/類
@Bean
public AccessDeniedHandler accessDeniedHandler(){
	AccessDeniedHandlerCustomImpl handler = new AccessDeniedHandlerCustomImpl();
	handler.setErrorPage("/accessDenied");
	return handler;
}
 
開發者ID:Azanx,項目名稱:Smart-Shopping,代碼行數:7,代碼來源:WebSecurityConfig.java

示例7: accessDeniedHandlerImpl

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

示例8: nonRedirectingAccessDeniedHandler

import org.springframework.security.web.access.AccessDeniedHandler; //導入依賴的package包/類
@Bean
public AccessDeniedHandler nonRedirectingAccessDeniedHandler(){
    return new AccessDeniedHandlerImpl();
}
 
開發者ID:PacktPublishing,項目名稱:Spring-Security-Third-Edition,代碼行數:5,代碼來源:SecurityConfig.java

示例9: accessDeniedHandler

import org.springframework.security.web.access.AccessDeniedHandler; //導入依賴的package包/類
private AccessDeniedHandler accessDeniedHandler() {
    return new CsrfAccessDeniedHandler() {
    };
}
 
開發者ID:swri-robotics,項目名稱:bag-database,代碼行數:5,代碼來源:SecurityConfig.java

示例10: setOrdinaryAccessDeniedHandler

import org.springframework.security.web.access.AccessDeniedHandler; //導入依賴的package包/類
public void setOrdinaryAccessDeniedHandler(AccessDeniedHandler pImpl) {
    this.pImpl = pImpl;
}
 
開發者ID:opendatakit,項目名稱:aggregate,代碼行數:4,代碼來源:GWTAccessDeniedHandlerImpl.java

示例11: accessDeniedHandler

import org.springframework.security.web.access.AccessDeniedHandler; //導入依賴的package包/類
@Bean
public AccessDeniedHandler accessDeniedHandler() {
    LinkedHashMap<Class<? extends AccessDeniedException>, AccessDeniedHandler> handlers = new LinkedHashMap<>();
    handlers.put(CsrfException.class, new CsrfTokenExceptionHandler());
    return new DelegatingAccessDeniedHandler(handlers, new AccessDeniedHandlerImpl());
}
 
開發者ID:vitalii-dmytruk,項目名稱:ConfLab,代碼行數:7,代碼來源:WebSecurityConfig.java

示例12: getOAuthFailureHandler

import org.springframework.security.web.access.AccessDeniedHandler; //導入依賴的package包/類
/**
 * The oauth failure handler.
 *
 * @return The oauth failure handler.
 */
public AccessDeniedHandler getOAuthFailureHandler() {
	return OAuthFailureHandler;
}
 
開發者ID:jungyang,項目名稱:oauth-client-master,代碼行數:9,代碼來源:OAuthConsumerContextFilter.java

示例13: setOAuthFailureHandler

import org.springframework.security.web.access.AccessDeniedHandler; //導入依賴的package包/類
/**
 * The oauth failure handler.
 *
 * @param OAuthFailureHandler The oauth failure handler.
 */
public void setOAuthFailureHandler(AccessDeniedHandler OAuthFailureHandler) {
	this.OAuthFailureHandler = OAuthFailureHandler;
}
 
開發者ID:jungyang,項目名稱:oauth-client-master,代碼行數:9,代碼來源:OAuthConsumerContextFilter.java


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